From ab502692721d3904912577e3aeab6e273d0aee5c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 20 Jul 2014 13:01:37 +0000 Subject: 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 --- src/modules/database/profilemanager.cpp | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'src/modules/database/profilemanager.cpp') 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) -- cgit v1.2.3