QtPass 1.5.1
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
singleapplication.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2016 Anne Jan Brouwer
2// SPDX-License-Identifier: GPL-3.0-or-later
3#ifndef SRC_SINGLEAPPLICATION_H_
4#define SRC_SINGLEAPPLICATION_H_
5
6#include <QApplication>
7#include <QLocalServer>
8#include <QSharedMemory>
9
16class SingleApplication : public QApplication {
17 Q_OBJECT
18public:
19 SingleApplication(int &argc, char *argv[], QString uniqueKey);
20 auto isRunning() -> bool;
21 auto sendMessage(const QString &message) -> bool;
22
23public slots:
24 void receiveMessage();
25
26signals:
31 void messageAvailable(const QString &message);
32
33private:
34 bool _isRunning;
35 QString _uniqueKey;
36 QSharedMemory sharedMemory;
37 QScopedPointer<QLocalServer> localServer;
38
39 static const int timeout = 1000;
40};
41
42#endif // SRC_SINGLEAPPLICATION_H_
The SingleApplication class is used for commandline intergration.
void receiveMessage()
SingleApplication::receiveMessage we have received (a command line) message.
auto isRunning() -> bool
SingleApplication::isRunning is there already a QtPass instance running, to check wether to be server...
void messageAvailable(const QString &message)
messageAvailable notification from commandline
auto sendMessage(const QString &message) -> bool
SingleApplication::sendMessage send a message (from commandline) to an already running QtPass instanc...
#define SingleApplication
Definition mainwindow.h:17