From 02e2ae2b77585b4f2726d9528ceea9ce4d99b453 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 31 Dec 2014 21:35:07 +0000 Subject: ability to run converter from old profile versions without launching Profile Manager, if the old profile is the only profile present git-svn-id: http://svn.miranda-ng.org/main/trunk@11703 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/database/database.cpp | 13 ++++++------- src/modules/database/profilemanager.cpp | 2 -- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/modules/database/database.cpp b/src/modules/database/database.cpp index 73794631d3..f782a5357d 100644 --- a/src/modules/database/database.cpp +++ b/src/modules/database/database.cpp @@ -258,13 +258,10 @@ static int getProfile1(TCHAR *szProfile, size_t cch, TCHAR *profiledir, BOOL * n switch (touchDatabase(newProfile, NULL)) { case 0: + case EGROKPRF_OBSOLETE: if (++found == 1 && bNoDefaultProfile) _tcsncpy_s(szProfile, cch, newProfile, _TRUNCATE); break; - - case EGROKPRF_OBSOLETE: - found += 2; // force showing PM even if only one obsolete profile found - break; } } while (FindNextFile(hFind, &ffd)); @@ -400,9 +397,13 @@ int tryOpenDatabase(const TCHAR *tszProfile) continue; case EGROKPRF_OBSOLETE: + EnsureCheckerLoaded(true); + CallService(MS_DB_CHECKPROFILE, (WPARAM)tszProfile, 2); break; + + default: + return err; } - return err; } bWasOpened = true; @@ -490,8 +491,6 @@ int LoadDatabaseModule(void) if (!getProfile(szProfile, SIZEOF(szProfile))) return 1; - EnsureCheckerLoaded(false); // unload dbchecker - if (arDbPlugins.getCount() == 0) { TCHAR buf[256]; TCHAR *p = _tcsrchr(szProfile, '\\'); diff --git a/src/modules/database/profilemanager.cpp b/src/modules/database/profilemanager.cpp index b15f1a74e4..24fcf8650e 100644 --- a/src/modules/database/profilemanager.cpp +++ b/src/modules/database/profilemanager.cpp @@ -293,14 +293,12 @@ BOOL EnumProfilesForList(TCHAR *tszFullPath, TCHAR *profile, LPARAM lParam) } DATABASELINK *dblink; - bool bNeedConversion = false; switch (touchDatabase(tszFullPath, &dblink)) { case ERROR_SUCCESS: item.iImage = bFileLocked; break; case EGROKPRF_OBSOLETE: - bNeedConversion = true; item.iImage = 2; break; -- cgit v1.2.3