mirror of
				https://github.com/yuezk/GlobalProtect-openconnect.git
				synced 2025-05-20 07:26:58 -04:00 
			
		
		
		
	Add singleapplication for service
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
| @@ -1,11 +1,10 @@ | ||||
| #include <QCoreApplication> | ||||
| #include <QtDBus> | ||||
|  | ||||
| #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(); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user