summaryrefslogtreecommitdiff
path: root/plugins/SecureIM/src/options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/SecureIM/src/options.cpp')
-rw-r--r--plugins/SecureIM/src/options.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp
index 386fc023bf..795e88b14c 100644
--- a/plugins/SecureIM/src/options.cpp
+++ b/plugins/SecureIM/src/options.cpp
@@ -985,10 +985,9 @@ void RefreshGeneralDlg(HWND hDlg, BOOL iInit)
LVITEM lvi; memset(&lvi,0,sizeof(lvi));
lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
- HANDLE hContact = db_find_first();
char tmp[NAMSIZE];
- while (hContact) {
+ for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
pUinKey ptr = getUinKey(hContact);
if (ptr && isSecureProtocol(hContact) && !isChatRoom(hContact)) {
if (iInit) {
@@ -1013,7 +1012,6 @@ void RefreshGeneralDlg(HWND hDlg, BOOL iInit)
else setListViewPUB(hLV, itemNum, hasKey(ptr));
setListViewIcon(hLV, itemNum, ptr);
}
- hContact = db_find_next(hContact);
}
ListView_Sort(hLV,0);
}
@@ -1073,10 +1071,9 @@ void RefreshPGPDlg(HWND hDlg, BOOL iInit)
LVITEM lvi; memset(&lvi,0,sizeof(lvi));
lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
- HANDLE hContact = db_find_first();
char tmp[NAMSIZE];
- while (hContact) {
+ for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
pUinKey ptr = getUinKey(hContact);
if (ptr && ptr->mode == MODE_PGP && isSecureProtocol(hContact) /*&& !getMetaContact(hContact)*/ && !isChatRoom(hContact)) {
LPSTR szKeyID = db_get_sa(hContact,MODULENAME,"pgp_abbr");
@@ -1095,7 +1092,6 @@ void RefreshPGPDlg(HWND hDlg, BOOL iInit)
LV_SetItemTextA(hLV, itemNum, 2, (szKeyID)?szKeyID:Translate(sim221));
SAFE_FREE(szKeyID);
}
- hContact = db_find_next(hContact);
}
ListView_Sort(hLV,(LPARAM)0x10);
}
@@ -1135,10 +1131,9 @@ void RefreshGPGDlg(HWND hDlg, BOOL iInit)
LVITEM lvi; memset(&lvi,0,sizeof(lvi));
lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
- HANDLE hContact = db_find_first();
char tmp[NAMSIZE];
- while (hContact) {
+ for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
pUinKey ptr = getUinKey(hContact);
if (ptr && ptr->mode == MODE_GPG && isSecureProtocol(hContact) /*&& !getMetaContact(hContact)*/ && !isChatRoom(hContact)) {
if (iInit )
@@ -1161,7 +1156,6 @@ void RefreshGPGDlg(HWND hDlg, BOOL iInit)
LV_SetItemTextA(hLV, itemNum, 3, (ptr->tgpgMode)?Translate(sim228):Translate(sim229));
SAFE_FREE(szKeyID);
}
- hContact = db_find_next(hContact);
}
ListView_Sort(hLV,(LPARAM)0x20);
}