summaryrefslogtreecommitdiff
path: root/plugins/SecureIM
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-16 20:01:14 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-16 20:01:14 +0300
commit39390b02dbd5aa7eb21a83773fa561b39f8828bc (patch)
tree7982eda1257f7466b5663c2865fdb7804c397257 /plugins/SecureIM
parent5046973a41e412afd06d6a78a3b9bce226e3cf50 (diff)
always hated these long expressions: contact_iter makes them much shorter
Diffstat (limited to 'plugins/SecureIM')
-rw-r--r--plugins/SecureIM/src/crypt_icons.cpp2
-rw-r--r--plugins/SecureIM/src/crypt_lists.cpp2
-rw-r--r--plugins/SecureIM/src/options.cpp8
3 files changed, 6 insertions, 6 deletions
diff --git a/plugins/SecureIM/src/crypt_icons.cpp b/plugins/SecureIM/src/crypt_icons.cpp
index 2c7eb2fd75..a428bdbefc 100644
--- a/plugins/SecureIM/src/crypt_icons.cpp
+++ b/plugins/SecureIM/src/crypt_icons.cpp
@@ -109,7 +109,7 @@ void RefreshContactListIcons(void)
for (auto &it : arIcoList)
it->hCLIcon = nullptr;
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (auto &hContact : contact_iter())
if (isSecureProtocol(hContact))
ShowStatusIcon(hContact);
}
diff --git a/plugins/SecureIM/src/crypt_lists.cpp b/plugins/SecureIM/src/crypt_lists.cpp
index be5f6a5e0a..9ccba72941 100644
--- a/plugins/SecureIM/src/crypt_lists.cpp
+++ b/plugins/SecureIM/src/crypt_lists.cpp
@@ -120,7 +120,7 @@ void loadContactList()
freeContactList();
loadSupportedProtocols();
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (auto &hContact : contact_iter())
addContact(hContact);
}
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp
index 3a5065d88f..0912acf37b 100644
--- a/plugins/SecureIM/src/options.cpp
+++ b/plugins/SecureIM/src/options.cpp
@@ -975,7 +975,7 @@ void RefreshGeneralDlg(HWND hDlg, BOOL iInit)
char tmp[NAMSIZE];
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (auto &hContact : contact_iter()) {
pUinKey ptr = getUinKey(hContact);
if (ptr && isSecureProtocol(hContact) && !isChatRoom(hContact)) {
if (iInit) {
@@ -1061,7 +1061,7 @@ void RefreshPGPDlg(HWND hDlg, BOOL iInit)
char tmp[NAMSIZE];
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (auto &hContact : contact_iter()) {
pUinKey ptr = getUinKey(hContact);
if (ptr && ptr->mode == MODE_PGP && isSecureProtocol(hContact) && !isChatRoom(hContact)) {
LPSTR szKeyID = db_get_sa(hContact, MODULENAME, "pgp_abbr");
@@ -1121,7 +1121,7 @@ void RefreshGPGDlg(HWND hDlg, BOOL iInit)
char tmp[NAMSIZE];
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (auto &hContact : contact_iter()) {
pUinKey ptr = getUinKey(hContact);
if (ptr && ptr->mode == MODE_GPG && isSecureProtocol(hContact) && !isChatRoom(hContact)) {
if (iInit)
@@ -1174,7 +1174,7 @@ void ResetGeneralDlg(HWND hDlg)
lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
char tmp[NAMSIZE];
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (auto &hContact : contact_iter()) {
if (!isSecureProtocol(hContact) || isChatRoom(hContact))
continue;