* 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>
* 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
* 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()