aboutsummaryrefslogtreecommitdiff
path: root/singleapplication_p.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Provide API for blocking sendMessage (#154)Christoph Cullmann2022-04-051-2/+8
|
* make it compile with Qt 6.2.x and stricter compile settingsChristoph Cullmann2022-04-031-4/+4
|
* fix deprecated warnings on Qt6.3+Moody2022-02-131-0/+4
|
* Fix crash when sending ack on removed connectionNicolas Werner2021-11-241-1/+3
| | | | | | | | | | The emit might interrupt our function and causes us to return to the event loop. In that time frame the other and might close the connection, causing our connection to be removed. In that case we call writeAck on a dangling pointer, in the best case causing a crash. So lets finish our business before emitting our signal. fixes #138
* Update singleapplication_p.cppItay Grudev2021-09-201-1/+1
|
* Update singleapplication_p.cppItay Grudev2021-09-201-1/+1
| | | Co-authored-by: Hennadii Chernyshchyk <genaloner@gmail.com>
* Update singleapplication_p.cppItay Grudev2021-09-201-2/+4
|
* Style and explanation improvementsItay Grudev2021-09-201-4/+4
|
* Compile fixMichael Klein2021-09-201-1/+1
| | | Co-authored-by: Hennadii Chernyshchyk <genaloner@gmail.com>
* Use QByteArray instead of QStringMichael Klein2021-09-201-1/+1
| | | Co-authored-by: Hennadii Chernyshchyk <genaloner@gmail.com>
* Use AppImage path for hash when running as AppImage.Michael Klein2021-09-201-1/+8
| | | | | | | | | | | | When an application is launched as AppImage, each instance is launched from its own FUSE-mounted filesystem, so each instance has its own executable path. The AppImage runtime sets the environment variable APPIMAGE to the absolute path to the .AppImage file, so we can use the content of this variable instead of QApplication::applicationFilePath() when set. Closes #77, #137
* Ensure data sent via SingleApplication::sendMessage is received completelyNils Jeisecke2021-06-011-25/+50
| | | | | | | | | | | | | Whilst the initial "connect" message is framed with a length header, this was missing for the user data. Thus there was no guarantee that the message frame was really received completely on emitting the "receivedMessage" signal. This change splits the previous "StageConnected" state into "StageConnectedHeader" and "StageConnectedBody" and does some refactoring to allow using the same write and read functions as the "init" messages.
* Add simple acknowledge protocol to ensure the server has received all dataNils Jeisecke2021-05-311-10/+28
| | | | | | | | | | | | | | | The server now acknowledges every received message by sending a \r. By waiting for the acknowledgement, clients should no longer terminate too early, causing bytes getting lost in Qt's internal socket handling. Message handling in the server is simplified because we can now rely on the readyRead signal being raised for every frame. This should finally solve #125 and #121. What remains is to correctly handle data sent using SingleApplication::sendMessage.
* Simplify randomSleep() for old Qt versionShatur952021-04-121-1/+1
|
* Fix signal-slot issuesJonas Kvinge2021-03-261-7/+7
|
* Update singleapplication_p.cppdail88592020-12-231-2/+1
| | | Co-authored-by: Hennadii Chernyshchyk <genaloner@gmail.com>
* Remove ConnectionInfo after socket is destroyeddail88592020-12-221-3/+5
| | | | | | This leaves the ConnectionInfo in a valid state, even after the socket is disconnected, which could still have a readyRead() signal emitted. Closes #123
* Allow adding unique userdata to instancesLoren Burkholder2020-12-161-3/+16
|
* Merge pull request #114 from Shatur95/fix-clang-tidy-warningsItay Grudev2020-10-181-11/+9
|\ | | | | Fix Clang Tidy warnings
| * Remove unused marcoShatur952020-10-151-2/+0
| | | | | | | | No longer needed since applicationPid() now is static.
| * Fix Clang Tidy warningsShatur952020-10-151-9/+9
| | | | | | | | | | | | | | readability-convert-member-functions-to-static readability-static-accessed-through-instance readability-make-member-function-const readability-inconsistent-declaration-parameter-name
* | Fix use of qChecksum with Qt 6Jonas Kvinge2020-10-181-5/+15
|/
* Fix implicit conversionShatur952020-10-151-2/+2
|
* Fix conversion from int to quint32Shatur952020-10-101-1/+1
|
* Fix build issue with MinGW GCC pedantic modeiakov2020-10-061-1/+3
| | | Without guard this define from https://github.com/itay-grudev/SingleApplication/commit/3230430311c3b9d027a0ef23c3657eed3caaa696#diff-35c7c4188004bde084344a3aa8eeab6dR60 introduced compilation warning/error, and can break compilation
* Fix return value of connectToPrimary() when connect is successfulJonas Kvinge2020-10-051-3/+2
|
* fixed build with Qt 5.9 MSVC2017Nick Korotysh2020-10-021-0/+1
| | | | | | 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.
* Removed debugging information for the instanceStarted signalItay Grudev2020-09-091-1/+0
|
* Improved the connectToPrimary() method and fixed issue with ↵Itay Grudev2020-09-091-32/+41
| | | | instanceStarted() not getting emitted
* Moved the random sleep functionality to SingleApplicationPrivateItay Grudev2020-09-091-0/+18
|
* Removed extra qDebug statementsItay Grudev2020-09-091-5/+0
|
* Mitigated possible race condition during app startupItay Grudev2020-09-091-32/+41
|
* Use qstrncpyShatur952020-07-021-2/+1
| | | | Fixes MSVC C4996 warning.
* Fix Clang Tidy warningsShatur952020-05-171-5/+5
|
* Update singleapplication_p.cppItay Grudev2020-04-221-1/+1
|
* Fix a crash when exiting an application on Android and iOSEmeric2020-04-201-12/+14
|
* Add support for Qt < 5.10Leander Schulten2020-03-271-1/+10
|
* The codec for string from qgetenv and pw->pw_name is not necessarily utf8. ↵Leander Schulten2020-03-271-8/+9
| | | | So use QString::fromLocal8Bit and QStrings.
* v3.1.0a Added primaryUser()Itay Grudev2020-03-031-22/+38
| | | | Closes #95
* Fix compilation warning/error (#74)iakov2019-10-101-5/+3
| | | | 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.
* Use geteuid and getpwuid to get username on Unix, fallback to environment ↵Jonas Kvinge2019-09-221-15/+18
| | | | | | | | variable (#72) * Use geteuid and getpwuid to get username on Unix, fallback to environment variable * Remove QProcess include
* v3.0.143.0.14Itay Grudev2019-01-221-0/+2
|
* fixed build process below Qt 5.6 (#57)Patrizio Bekerle2018-12-141-0/+13
|
* Async socket processing (#49)3.0.13aFrancis Giraldeau2018-09-101-68/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* v3.0.12a Removed custom signal handling.3.0.12aItay Grudev2018-07-271-43/+0
|
* Proposed SA changes still containing a race condition (#48)3.0.11aItay Grudev2018-07-271-0/+392