aboutsummaryrefslogtreecommitdiff
path: root/libraries/LocalPeer/include
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2023-08-04 19:42:36 +0200
committerGitHub <noreply@github.com>2023-08-04 19:42:36 +0200
commitae793f6cf11658c9abc5111e82d5ba7b3e6af127 (patch)
treeed41f30e2c0f02e4be1d42324b3f05fbab75b2cd /libraries/LocalPeer/include
parent50c7d39e082f0a7dbd977401e16d5adf534d9770 (diff)
parent1d638e018ac40fbfb35dd117f9a948c0cf35eadd (diff)
downloadPrismLauncher-ae793f6cf11658c9abc5111e82d5ba7b3e6af127.tar.gz
PrismLauncher-ae793f6cf11658c9abc5111e82d5ba7b3e6af127.tar.bz2
PrismLauncher-ae793f6cf11658c9abc5111e82d5ba7b3e6af127.zip
Merge pull request #1459 from Scrumplex/format
Diffstat (limited to 'libraries/LocalPeer/include')
-rw-r--r--libraries/LocalPeer/include/LocalPeer.h44
1 files changed, 17 insertions, 27 deletions
diff --git a/libraries/LocalPeer/include/LocalPeer.h b/libraries/LocalPeer/include/LocalPeer.h
index 3619ed5d..c370102f 100644
--- a/libraries/LocalPeer/include/LocalPeer.h
+++ b/libraries/LocalPeer/include/LocalPeer.h
@@ -43,56 +43,46 @@
#include <QString>
#include <memory>
-
class QLocalServer;
class LockedFile;
-class ApplicationId
-{
-public: /* methods */
+class ApplicationId {
+ public: /* methods */
// traditional app = installed system wide and used in a multi-user environment
static ApplicationId fromTraditionalApp();
// ID based on a path with all the application data (no two instances with the same data path should run)
- static ApplicationId fromPathAndVersion(const QString & dataPath, const QString & version);
+ static ApplicationId fromPathAndVersion(const QString& dataPath, const QString& version);
// custom ID
- static ApplicationId fromCustomId(const QString & id);
+ static ApplicationId fromCustomId(const QString& id);
// custom ID, based on a raw string previously acquired from 'toString'
- static ApplicationId fromRawString(const QString & id);
-
+ static ApplicationId fromRawString(const QString& id);
- QString toString()
- {
- return m_id;
- }
+ QString toString() { return m_id; }
-private: /* methods */
- ApplicationId(const QString & value)
- {
- m_id = value;
- }
+ private: /* methods */
+ ApplicationId(const QString& value) { m_id = value; }
-private: /* data */
+ private: /* data */
QString m_id;
};
-class LocalPeer : public QObject
-{
+class LocalPeer : public QObject {
Q_OBJECT
-public:
- LocalPeer(QObject *parent, const ApplicationId &appId);
+ public:
+ LocalPeer(QObject* parent, const ApplicationId& appId);
~LocalPeer();
bool isClient();
- bool sendMessage(const QByteArray &message, int timeout);
+ bool sendMessage(const QByteArray& message, int timeout);
ApplicationId applicationId() const;
-Q_SIGNALS:
- void messageReceived(const QByteArray &message);
+ Q_SIGNALS:
+ void messageReceived(const QByteArray& message);
-protected Q_SLOTS:
+ protected Q_SLOTS:
void receiveConnection();
-protected:
+ protected:
ApplicationId id;
QString socketName;
std::unique_ptr<QLocalServer> server;