From b2c47fe47b18d21b90d9c536e70bf45ef9d33e3c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 26 Mar 2018 00:01:31 +0300 Subject: fixes #1208 (if profile is opened in r/w mode, it should be locked) --- src/mir_app/src/database.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/database.cpp b/src/mir_app/src/database.cpp index ce47bd9981..f0dbfa8077 100644 --- a/src/mir_app/src/database.cpp +++ b/src/mir_app/src/database.cpp @@ -505,19 +505,22 @@ int LoadDatabaseModule(void) } else if (rc > 0) { // if there were drivers but they all failed cos the file is locked, try and find the miranda which locked it + if (FindMirandaForProfile(szProfile)) + break; + if (fileExist(szProfile)) { // file isn't locked, just no driver could open it. MessageBox(nullptr, CMStringW(FORMAT, TranslateW(tszUnknownFormat), ptszFileName), TranslateT("Miranda can't understand that profile"), MB_OK | MB_ICONERROR); } - else if (!FindMirandaForProfile(szProfile)) { + else retry = IDRETRY == MessageBox(nullptr, CMStringW(FORMAT, TranslateW(tszProfileLocked), ptszFileName), TranslateT("Miranda can't open that profile"), MB_RETRYCANCEL | MB_ICONERROR); - } } - } while (retry); + } + while (retry); if (rc == ERROR_SUCCESS) { InitIni(); -- cgit v1.2.3