summaryrefslogtreecommitdiff
path: root/src/modules/database/profilemanager.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-07-20 13:01:37 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-07-20 13:01:37 +0000
commitab502692721d3904912577e3aeab6e273d0aee5c (patch)
treeb9f6e4f73e107c723efe4e70f072d3e2fd5d3bf9 /src/modules/database/profilemanager.cpp
parent2fd4ab0c905354393036e324e76527d7e78a2305 (diff)
single profile that requires conversion also to raise up Profile Manager
git-svn-id: http://svn.miranda-ng.org/main/trunk@9885 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/database/profilemanager.cpp')
-rw-r--r--src/modules/database/profilemanager.cpp30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/modules/database/profilemanager.cpp b/src/modules/database/profilemanager.cpp
index 8caf67b35b..f48beb47a4 100644
--- a/src/modules/database/profilemanager.cpp
+++ b/src/modules/database/profilemanager.cpp
@@ -291,25 +291,21 @@ BOOL EnumProfilesForList(TCHAR *tszFullPath, TCHAR *profile, LPARAM lParam)
bFileLocked = !fileExist(tszFullPath);
}
- DATABASELINK *dblink = NULL;
+ DATABASELINK *dblink;
bool bNeedConversion = false;
- for (int i = arDbPlugins.getCount() - 1; i >= 0; i--) {
- DATABASELINK *p = arDbPlugins[i];
- int iErrorCode = p->grokHeader(tszFullPath);
- if (iErrorCode == 0) {
- dblink = p;
- item.iImage = bFileLocked;
- break;
- }
- if (iErrorCode == EGROKPRF_OBSOLETE) {
- dblink = p;
- bNeedConversion = true;
- item.iImage = 2;
- break;
- }
- }
- if (dblink == NULL)
+ switch (touchDatabase(tszFullPath, &dblink)) {
+ case ERROR_SUCCESS:
+ item.iImage = bFileLocked;
+ break;
+
+ case EGROKPRF_OBSOLETE:
+ bNeedConversion = true;
+ item.iImage = 2;
+ break;
+
+ default:
item.iImage = 3;
+ }
int iItem = SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
if (lstrcmpi(ped->szProfile, tszFullPath) == 0)