/* * 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: https://neueland.iserlohn-fortress.net/smolbote.hg * * SPDX-License-Identifier: GPL-3.0 */ #ifndef SMOLBOTE_SINGLEAPPLICATION_H #define SMOLBOTE_SINGLEAPPLICATION_H #include class QLocalServer; class SingleApplication : public QApplication { Q_OBJECT public: explicit SingleApplication(int &argc, char **argv); ~SingleApplication() override; bool bindLocalSocket(const QString &name); QString serverName() const; int sendMessage(const QString &profileName, bool newWindow, const QStringList &urls); signals: void messageAvailable(const QString &profileName, bool newWindow, const QStringList &urls); private slots: void parseMessage(); private: const int LOCALSERVER_TIMEOUT = 500; QString LOCALSERVER_KEY; QLocalServer *m_localServer = nullptr; }; #endif // SMOLBOTE_SINGLEAPPLICATION_H