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