diff options
author | George Hazan <george.hazan@gmail.com> | 2014-07-21 17:34:33 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-07-21 17:34:33 +0000 |
commit | 25ee6fd0dc6853606daee61f9173db3a27b76722 (patch) | |
tree | febe1f6b66a734ca35c90538b4c1c0517e264343 /src | |
parent | d3ea6d2693b3e93c9dc62c75db2a9d5a67b9bce0 (diff) |
Profile Manager must be shown even if there is only one obsoleted profile
git-svn-id: http://svn.miranda-ng.org/main/trunk@9905 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/database/database.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/modules/database/database.cpp b/src/modules/database/database.cpp index b1d0675469..0ad7989467 100644 --- a/src/modules/database/database.cpp +++ b/src/modules/database/database.cpp @@ -231,14 +231,14 @@ static int getProfile1(TCHAR *szProfile, size_t cch, TCHAR *profiledir, BOOL * n moveProfileDirProfiles(profiledir);
moveProfileDirProfiles(profiledir, FALSE);
- bool nodprof = (*szProfile == 0);
- bool reqfd = !nodprof && (_taccess(szProfile, 0) == 0 || shouldAutoCreate(szProfile));
- bool shpm = showProfileManager();
+ bool bNoDefaultProfile = (*szProfile == 0);
+ bool reqfd = !bNoDefaultProfile && (_taccess(szProfile, 0) == 0 || shouldAutoCreate(szProfile));
+ bool bShowProfileManager = showProfileManager();
if (reqfd)
found++;
- if (shpm || !reqfd) {
+ if (bShowProfileManager || !reqfd) {
TCHAR searchspec[MAX_PATH];
mir_sntprintf(searchspec, SIZEOF(searchspec), _T("%s\\*.*"), profiledir);
@@ -257,11 +257,12 @@ static int getProfile1(TCHAR *szProfile, size_t cch, TCHAR *profiledir, BOOL * n switch (touchDatabase(newProfile, NULL)) {
case 0:
- if (found == 0 && nodprof)
+ if (++found == 1 && bNoDefaultProfile)
_tcsncpy_s(szProfile, cch, newProfile, _TRUNCATE);
+ break;
case EGROKPRF_OBSOLETE:
- found++;
+ found += 2; // force showing PM even if only one obsolete profile found
break;
}
}
@@ -269,13 +270,13 @@ static int getProfile1(TCHAR *szProfile, size_t cch, TCHAR *profiledir, BOOL * n FindClose(hFind);
}
- reqfd = (!shpm && found == 1 && nodprof);
+ reqfd = (!bShowProfileManager && found == 1 && bNoDefaultProfile);
}
if (noProfiles)
*noProfiles = (found == 0);
- if (nodprof && !reqfd)
+ if (bNoDefaultProfile && !reqfd)
szProfile[0] = 0;
return reqfd;
|