make sure that only one instance of the application runs
This commit is contained in:
parent
6c51f8cec5
commit
7a8c7a9d0b
1 changed files with 8 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
|
#include <QSharedMemory>
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
@ -16,6 +17,13 @@ int main(int argc, char* argv[])
|
||||||
QCoreApplication::setOrganizationDomain("rustysoft.de");
|
QCoreApplication::setOrganizationDomain("rustysoft.de");
|
||||||
QCoreApplication::setApplicationName("kima2");
|
QCoreApplication::setApplicationName("kima2");
|
||||||
|
|
||||||
|
// Make sure that only one instance of the application runs
|
||||||
|
// Of course the uuid used here is unique to this application
|
||||||
|
QSharedMemory shared("26297455-946a-4607-bfb7-5025a5f1e136");
|
||||||
|
if (!shared.create(512, QSharedMemory::ReadWrite)) {
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
QTranslator qTranslator;
|
QTranslator qTranslator;
|
||||||
QLocale german(QLocale::German);
|
QLocale german(QLocale::German);
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
|
|
Loading…
Reference in a new issue