diff --git a/GPService/GPService.pro b/GPService/GPService.pro index eb0b3a3..256352a 100644 --- a/GPService/GPService.pro +++ b/GPService/GPService.pro @@ -4,6 +4,9 @@ QT -= gui CONFIG += c++11 console CONFIG -= app_bundle +include(../singleapplication/singleapplication.pri) +DEFINES += QAPPLICATION_CLASS=QCoreApplication + # The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the diff --git a/GPService/main.cpp b/GPService/main.cpp index deaaa5b..530e1af 100644 --- a/GPService/main.cpp +++ b/GPService/main.cpp @@ -1,11 +1,10 @@ -#include #include - #include "gpservice.h" +#include "singleapplication.h" int main(int argc, char *argv[]) { - QCoreApplication a(argc, argv); + SingleApplication app(argc, argv); if (!QDBusConnection::systemBus().isConnected()) { qWarning("Cannot connect to the D-Bus session bus.\n" @@ -15,5 +14,5 @@ int main(int argc, char *argv[]) new GPService; - return a.exec(); + return app.exec(); }