summaryrefslogtreecommitdiff
path: root/plugins/CountryFlags
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/CountryFlags
parent5046973a41e412afd06d6a78a3b9bce226e3cf50 (diff)
always hated these long expressions: contact_iter makes them much shorter
Diffstat (limited to 'plugins/CountryFlags')
-rw-r--r--plugins/CountryFlags/src/extraimg.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/plugins/CountryFlags/src/extraimg.cpp b/plugins/CountryFlags/src/extraimg.cpp
index cd2d31a485..d12ebf746b 100644
--- a/plugins/CountryFlags/src/extraimg.cpp
+++ b/plugins/CountryFlags/src/extraimg.cpp
@@ -63,14 +63,14 @@ static void CALLBACK SetExtraImage(MCONTACT hContact)
// always call in context of main thread
static void RemoveExtraImages(void)
{
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (auto &hContact : contact_iter())
ExtraIcon_Clear(hExtraIcon, hContact);
}
// always call in context of main thread
static void EnsureExtraImages(void)
{
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (auto &hContact : contact_iter())
SetExtraImage(hContact);
}
@@ -135,8 +135,7 @@ static int MsgWndEvent(WPARAM, LPARAM lParam)
void CALLBACK UpdateStatusIcons(LPARAM)
{
- MCONTACT hContact = db_find_first();
- while (hContact != NULL) {
+ for (auto &hContact : contact_iter()) {
/* is a message window opened for this contact? */
MessageWindowData msgw; /* output */
if (!Srmm_GetWindowData(hContact, msgw) && msgw.uState & MSG_WINDOW_STATE_EXISTS) {
@@ -146,7 +145,6 @@ void CALLBACK UpdateStatusIcons(LPARAM)
}
else UnsetStatusIcon(hContact);
}
- hContact = db_find_next(hContact);
}
}