pineapple-music/singleapplicationmanager.h

37 lines
704 B
C
Raw Permalink Normal View History

2024-09-08 00:34:45 +08:00
// SPDX-FileCopyrightText: 2024 Gary Wang <git@blumia.net>
//
// SPDX-License-Identifier: MIT
2020-04-11 19:54:51 +08:00
#ifndef SINGLEAPPLICATIONMANAGER_H
#define SINGLEAPPLICATIONMANAGER_H
#include <QObject>
QT_BEGIN_NAMESPACE
class QLocalServer;
QT_END_NAMESPACE
class SingleApplicationManager : public QObject
{
Q_OBJECT
public:
explicit SingleApplicationManager(QString applicationKey, QObject *parent = nullptr);
void createSingleInstance();
bool checkSingleInstance(QVariant data);
signals:
void dataReached(QVariant data);
private slots:
void on_localSocket_newConnection();
private:
QString m_applicationKey;
QLocalServer * m_localServer;
};
#endif // SINGLEAPPLICATIONMANAGER_H