From 3ace62f90d48015fec1bd37ad216466fb666061d Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Fri, 22 Dec 2017 23:00:45 +0100 Subject: Single instance check works again - In Debug builds, startup time is calculated --- src/singleapplication.h | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src/singleapplication.h') diff --git a/src/singleapplication.h b/src/singleapplication.h index 053ead2..fd9ce39 100644 --- a/src/singleapplication.h +++ b/src/singleapplication.h @@ -10,29 +10,39 @@ #define SINGLEAPPLICATION_H #include +#include class QLocalServer; class SingleApplication : public QApplication { Q_OBJECT + public: + + struct SessionParam + { + QString profile; + bool newWindow; + QVector urls; + }; + explicit SingleApplication(int &argc, char **argv); ~SingleApplication(); - void bindLocalSocket(); + bool bindLocalSocket(const QString &name = QString()); + QString serverName() const; - bool isRunning(); - bool sendMessage(const QHash ¶ms); + int sendMessage(const SessionParam ¶ms); signals: - void messageAvailable(const QHash ¶ms); + void messageAvailable(const SessionParam ¶ms); private slots: - void slot_receiveMessage(); + void parseMessage(); private: const int LOCALSERVER_TIMEOUT = 500; - const QString LOCALSERVER_KEY = "smolbote_socket"; + QString LOCALSERVER_KEY; QLocalServer *m_localServer = nullptr; }; -- cgit v1.2.1