From 08d8b5b8867c21b7cca9cbddada32ec3d4b63939 Mon Sep 17 00:00:00 2001 From: Ista Zahn Date: Wed, 14 Jul 2021 06:12:45 -0400 Subject: [PATCH] Use separate lockfile for each user. --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 955a7495..66c459bd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -198,7 +198,9 @@ int main(int argc, char *argv[]) { // qDebug() << QString("main.cpp tmpDir: " + tmpDir); // not most elegant as fixed name but in reality not big deal - QLockFile lockFile(tmpDir + "/.RcloneBrowser_4q6RgLs2RpbJA.lock"); + char* lockLocalUserName = std::getenv("USER"); + QLockFile lockFile(tmpDir + "/." + lockLocalUserName + "RcloneBrowser_4q6RgLs2RpbJA.lock"); + if (!lockFile.tryLock(100)) { // if already running display warning and quit