/* * 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 class QLocalServer; class SingleApplication : public QApplication { Q_OBJECT public: explicit SingleApplication(int &argc, char **argv); ~SingleApplication(); void bindLocalSocket(); bool isRunning(); bool sendMessage(const QHash ¶ms); signals: void messageAvailable(const QHash ¶ms); private slots: void slot_receiveMessage(); private: const int LOCALSERVER_TIMEOUT = 500; const QString LOCALSERVER_KEY = "smolbote_socket"; QLocalServer *m_localServer = nullptr; }; #endif // SINGLEAPPLICATION_H