Commit Graph

30 Commits

Author SHA1 Message Date
dail8859
99cd51d5a2 Remove ConnectionInfo after socket is destroyed
This leaves the ConnectionInfo in a valid state, even after the socket is disconnected, which could still have a readyRead() signal emitted.

Closes #123
2020-12-22 21:03:10 -05:00
Loren Burkholder
f236032cf9 Allow adding unique userdata to instances 2020-12-16 22:17:24 -05:00
Itay Grudev
a627bc24fa
Merge pull request #114 from Shatur95/fix-clang-tidy-warnings
Fix Clang Tidy warnings
2020-10-18 09:44:21 +01:00
Jonas Kvinge
b5e6e2ba75 Fix use of qChecksum with Qt 6 2020-10-18 00:58:52 +02:00
Shatur95
199defc4dd Remove unused marco
No longer needed since applicationPid() now is static.
2020-10-15 23:06:50 +03:00
Shatur95
e17c715faf Fix Clang Tidy warnings
readability-convert-member-functions-to-static
readability-static-accessed-through-instance
readability-make-member-function-const
readability-inconsistent-declaration-parameter-name
2020-10-15 21:41:00 +03:00
Shatur95
a8fb6b49f5 Fix implicit conversion 2020-10-15 01:29:25 +03:00
Shatur95
fae8a8a65f Fix conversion from int to quint32 2020-10-10 20:31:47 +03:00
iakov
800bb858a8
Fix build issue with MinGW GCC pedantic mode
Without guard this define from 3230430311 (diff-35c7c4188004bde084344a3aa8eeab6dR60) introduced compilation warning/error, and can break compilation
2020-10-06 13:56:20 +03:00
Jonas Kvinge
a121f61ca1 Fix return value of connectToPrimary() when connect is successful 2020-10-05 22:13:03 +02:00
Nick Korotysh
3230430311
fixed build with Qt 5.9 MSVC2017
define NOMINMAX before <Windows.h> inclusion to disable min/max macros
defined in it. these macros conflict with any min/max functions and it
is common practice to disable them adding NOMINMAX define.
2020-10-02 14:17:34 +03:00
Itay Grudev
ca8e9aaa9e Removed debugging information for the instanceStarted signal 2020-09-09 02:30:43 +01:00
Itay Grudev
3e83f5ce13 Improved the connectToPrimary() method and fixed issue with instanceStarted() not getting emitted 2020-09-09 02:28:07 +01:00
Itay Grudev
eca5803665 Moved the random sleep functionality to SingleApplicationPrivate 2020-09-09 02:23:42 +01:00
Itay Grudev
fb9c0bd2ef Removed extra qDebug statements 2020-09-09 00:48:55 +01:00
Itay Grudev
e4282f2476 Mitigated possible race condition during app startup 2020-09-09 00:28:02 +01:00
Shatur95
c5042727ae Use qstrncpy
Fixes MSVC C4996 warning.
2020-07-02 02:36:54 +03:00
Shatur95
fcd4fcab21 Fix Clang Tidy warnings 2020-05-17 17:50:27 +03:00
Itay Grudev
f31880dc7f
Update singleapplication_p.cpp 2020-04-22 00:58:15 +01:00
Emeric
b4a1f19d81 Fix a crash when exiting an application on Android and iOS 2020-04-20 18:33:30 +02:00
Leander Schulten
00a2530465 Add support for Qt < 5.10 2020-03-27 08:24:43 +01:00
Leander Schulten
49c282a64c The codec for string from qgetenv and pw->pw_name is not necessarily utf8. So use QString::fromLocal8Bit and QStrings. 2020-03-27 07:52:48 +01:00
Itay Grudev
81cc2719be v3.1.0a Added primaryUser()
Closes #95
2020-03-03 01:24:55 +00:00
iakov
196bb34af6 Fix compilation warning/error (#74)
Fix `comparison between signed and unsigned integer expressions` problem.
User ID is a positive integer  in Linux/UNIX(macOS, FreeBSD, Solaris), also `geteuid()` never fails with return code.
2019-10-10 14:47:25 +03:00
Jonas Kvinge
2c959069b7 Use geteuid and getpwuid to get username on Unix, fallback to environment variable (#72)
* Use geteuid and getpwuid to get username on Unix, fallback to environment variable

* Remove QProcess include
2019-09-22 20:39:45 +03:00
Itay Grudev
adac9a30aa
v3.0.14 2019-01-22 12:23:51 +00:00
Patrizio Bekerle
b24d5394a5 fixed build process below Qt 5.6 (#57) 2018-12-14 20:41:55 +02:00
Francis Giraldeau
0db27016b0 Async socket processing (#49)
* Process socket events asynchronously

Avoid blocking the event loop using waitForReadyRead(). Instead, process the
initialization in two phases. It was necessary to add a map to keep track of
the state of the initial message processing

Signed-off-by: Francis Giraldeau <francis.giraldeau@nrc-cnrc.gc.ca>

* Fix undefined variable on Windows

The timout variable does not exists in this scope, we can safely remove the
Q_UNUSED.

Signed-off-by: Francis Giraldeau <francis.giraldeau@nrc-cnrc.gc.ca>

* Fix validation logic of initial message

I modified the logic to a positive value, but the modification was incomplete
and caused the initial message to be incorrectly considered as invalid.

Signed-off-by: Francis Giraldeau <francis.giraldeau@nrc-cnrc.gc.ca>

* Use the proper socket when receiving message

The socket variable is a class member, but we really want to use
nextConnSocket when receiving the message in the lambda.

Signed-off-by: Francis Giraldeau <francis.giraldeau@nrc-cnrc.gc.ca>
2018-09-10 22:35:38 +01:00
Itay Grudev
9357d19042
v3.0.12a Removed custom signal handling. 2018-07-27 12:59:31 +03:00
Itay Grudev
46b2204a3f
Proposed SA changes still containing a race condition (#48) 2018-07-27 04:29:55 +03:00