/* * This file is part of smolbote. It's copyrighted by the contributors recorded * in the version control history of the file, available from its original * location: git://neueland.iserlohn-fortress.net/smolbote.git * * SPDX-License-Identifier: GPL-3.0 */ #ifndef SINGLEAPPLICATION_H #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(); bool bindLocalSocket(const QString &name = QString()); QString serverName() const; int sendMessage(const SessionParam ¶ms); signals: void messageAvailable(const SessionParam ¶ms); private slots: void parseMessage(); private: const int LOCALSERVER_TIMEOUT = 500; QString LOCALSERVER_KEY; QLocalServer *m_localServer = nullptr; }; #endif // SINGLEAPPLICATION_H