aboutsummaryrefslogtreecommitdiff
path: root/singleapplication_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Provide API for blocking sendMessage (#154)Christoph Cullmann2022-04-051-1/+1
|
* Ensure data sent via SingleApplication::sendMessage is received completelyNils Jeisecke2021-06-011-5/+8
| | | | | | | | | | | | | 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-0/+2
| | | | | | | | | | | | | | | 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.
* Allow adding unique userdata to instancesLoren Burkholder2020-12-161-0/+3
|
* Fix Clang Tidy warningsShatur952020-10-151-7/+7
| | | | | | | readability-convert-member-functions-to-static readability-static-accessed-through-instance readability-make-member-function-const readability-inconsistent-declaration-parameter-name
* Improved the connectToPrimary() method and fixed issue with ↵Itay Grudev2020-09-091-1/+1
| | | | instanceStarted() not getting emitted
* Moved the random sleep functionality to SingleApplicationPrivateItay Grudev2020-09-091-0/+1
|
* Mitigated possible race condition during app startupItay Grudev2020-09-091-1/+1
|
* Fix Clang Tidy warningsShatur952020-05-171-6/+4
|
* Update singleapplication_p.hItay Grudev2020-04-221-1/+1
|
* The codec for string from qgetenv and pw->pw_name is not necessarily utf8. ↵Leander Schulten2020-03-271-2/+2
| | | | So use QString::fromLocal8Bit and QStrings.
* v3.1.0a Added primaryUser()Itay Grudev2020-03-031-0/+3
| | | | Closes #95
* Async socket processing (#49)3.0.13aFrancis Giraldeau2018-09-101-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-5/+0
|
* Proposed SA changes still containing a race condition (#48)3.0.11aItay Grudev2018-07-271-4/+7
|
* removed c style casts and eliminated all clang warnings, ... (#38)Jedidiah Buck McCready2017-12-031-1/+7
| | | | | | * removed c style casts and eliminated all clang warnings, fixed instanceId reading from only one byte in deserialization of message, cleaned up serialization code using QDataStream, changed connection type to use quint8 enum rather than char * renamed SingleAppConnectionType to ConnectionType, added initialization values to all ConnectionType enum cases
* Primary PID support (#36)v3.0.9Itay Grudev2017-10-021-0/+2
| | | | | | | | | | | * Added the ability to bring the primary application window to the foreground on Windows systems by adding an option flag. THis option can only be used in Windows development and in applications derived from QApplication with a QMainWindow object. Because the primary application needs to be instructed to go to the foreground, the option SecondaryNotification must also be set to use this functionality * Changed the ability to bring the primary application window to the front as discussed in itay-grudev/SingleApplication#31. Now the process ID of the primary application get stored and is accessible for other instances of the application. It is to the developer to bring the applications windows to the front. For convenience the accompanying readme now contains a paragraph with example of how to do this on Windows systems. * v3.0.9 Added SingleApplicationPrivate::primaryPid()
* Removed QMutex for thread safe behaviour and support for multiple ↵Itay Grudev2017-04-231-3/+0
| | | | | SingleApplication instances Problem raised by @retmas in #24
* Refactored SingleApplicationPrivate destructor.Itay Grudev2017-01-301-1/+0
| | | | | Deleted the separate cleanUp method as it’s not used from anywhere but the destructor.
* Added missing "QMutex" dependenciesSvintsov Dmitry2016-08-221-0/+1
|
* SingleApplication v3.0aItay Grudev2016-08-101-0/+80