syncthingtray/tray/application/singleinstance.h
Martchus 6470038fc7 Refactor to allow sharing backend with other apps
Intended for creating command line tool and plasmoid
2016-09-30 23:58:45 +02:00

35 lines
527 B
C++

#ifndef SINGLEINSTANCE_H
#define SINGLEINSTANCE_H
#include <QObject>
QT_FORWARD_DECLARE_CLASS(QLocalServer)
namespace Data {
struct SyncthingDir;
}
namespace QtGui {
class SingleInstance : public QObject
{
Q_OBJECT
public:
SingleInstance(int argc, const char *const *argv, QObject *parent = nullptr);
Q_SIGNALS:
void newInstance(int argc, const char *const *argv);
private Q_SLOTS:
void handleNewConnection();
void readArgs();
private:
QLocalServer *m_server;
};
}
#endif // SINGLEINSTANCE_H