From e96241265e31264eaa96fda34c7a69c1f1ecf6c0 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sun, 23 Feb 2020 13:40:04 +0100 Subject: Use third_party singleapplication helper This may still not raise the application correctly on some WMs, because they don't allow disturbing the user with windows popping up. I don't think we want to work around that. fixes #84 fixes #113 --- src/RunGuard.h | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 src/RunGuard.h (limited to 'src/RunGuard.h') diff --git a/src/RunGuard.h b/src/RunGuard.h deleted file mode 100644 index f9a9641a..00000000 --- a/src/RunGuard.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -// -// Taken from -// https://stackoverflow.com/questions/5006547/qt-best-practice-for-a-single-instance-app-protection -// - -#include -#include -#include - -class RunGuard -{ -public: - RunGuard(const QString &key); - ~RunGuard(); - - bool isAnotherRunning(); - bool tryToRun(); - void release(); - -private: - const QString key; - const QString memLockKey; - const QString sharedmemKey; - - QSharedMemory sharedMem; - QSystemSemaphore memLock; - - Q_DISABLE_COPY(RunGuard) -}; -- cgit 1.5.1