QtPass
$ENV{QTPASS_VERSION}
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
src
singleapplication.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2014 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
56
class
SingleApplication
:
public
QApplication {
57
Q_OBJECT
58
public
:
59
SingleApplication
(
int
&argc,
char
*argv[], QString uniqueKey);
60
auto
isRunning
() -> bool;
61
auto
sendMessage
(
const
QString &message) -> bool;
62
63
public
slots:
64
void
receiveMessage
();
65
66
signals:
71
void
messageAvailable
(
const
QString &message);
72
73
private
:
74
bool
_isRunning;
75
QString _uniqueKey;
76
QSharedMemory sharedMemory;
77
QScopedPointer<QLocalServer> localServer;
78
79
static
const
int
timeout = 1000;
80
};
81
82
#endif
// SRC_SINGLEAPPLICATION_H_
SingleApplication
Provide single-instance application behavior and inter-process messaging using a unique key.
Definition
singleapplication.h:56
SingleApplication::receiveMessage
void receiveMessage()
SingleApplication::receiveMessage we have received (a command line) message.
Definition
singleapplication.cpp:46
SingleApplication::isRunning
auto isRunning() -> bool
SingleApplication::isRunning is there already a QtPass instance running, to check wether to be server...
Definition
singleapplication.cpp:66
SingleApplication::messageAvailable
void messageAvailable(const QString &message)
messageAvailable notification from commandline
SingleApplication::sendMessage
auto sendMessage(const QString &message) -> bool
SingleApplication::sendMessage send a message (from commandline) to an already running QtPass instanc...
Definition
singleapplication.cpp:74
SingleApplication
#define SingleApplication
Definition
mainwindow.h:17
Generated by
1.9.8