diff options
author | Itay Grudev <itay@grudev.com> | 2016-05-04 20:51:06 +0100 |
---|---|---|
committer | Itay Grudev <itay@grudev.com> | 2016-05-04 20:51:06 +0100 |
commit | 6fe44039410e7330349c2e783ec2ccfe68534715 (patch) | |
tree | 455ed73cf7eabf01703830e9f36bb3d577248782 | |
parent | Improved restoring QSharedMemory after crash (diff) | |
download | singleapplication-6fe44039410e7330349c2e783ec2ccfe68534715.tar.xz |
Bugfix no showUp notification. Some minor improvements
-rw-r--r-- | singleapplication.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/singleapplication.cpp b/singleapplication.cpp index c5f52dc..b63abdc 100644 --- a/singleapplication.cpp +++ b/singleapplication.cpp @@ -41,14 +41,14 @@ public: #endif // Successful creation means that no main process exists // So we start a QLocalServer to listen for connections - server = new QLocalServer(); QLocalServer::removeServer( memory->key() ); + server = new QLocalServer(); server->listen( memory->key() ); QObject::connect( server, - SIGNAL( newConnection() ), + &QLocalServer::newConnection, q, - SLOT( slotConnectionEstablished() ) + &SingleApplication::slotConnectionEstablished ); // Reset the number of connections @@ -73,6 +73,11 @@ public: crashHandler(); #endif + notifyPrimary(); + } + + void notifyPrimary() + { // Connect to the Local Server of the main process to notify it // that a new process had been started QLocalSocket socket; @@ -225,7 +230,8 @@ SingleApplication::SingleApplication(int &argc, char *argv[], uint8_t secondaryI } } - delete d->memory; + d->notifyPrimary(); + delete d; ::exit(EXIT_SUCCESS); } |