From 39390b02dbd5aa7eb21a83773fa561b39f8828bc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 16 Mar 2018 20:01:14 +0300 Subject: always hated these long expressions: contact_iter makes them much shorter --- plugins/Popup/src/opt_contacts.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/Popup/src') diff --git a/plugins/Popup/src/opt_contacts.cpp b/plugins/Popup/src/opt_contacts.cpp index 0bb94612f6..d42762c740 100644 --- a/plugins/Popup/src/opt_contacts.cpp +++ b/plugins/Popup/src/opt_contacts.cpp @@ -30,7 +30,7 @@ static void sttResetListOptions(HWND hwndList) static void sttSetAllContactIcons(HWND hwndList) { - for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (auto &hContact : contact_iter()) { HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0); DWORD dwMode = db_get_b(hContact, MODULNAME, "ShowMode", 0); for (int i = 0; i < 4 /*_countof(sttIcons)*/; ++i) @@ -99,7 +99,7 @@ INT_PTR CALLBACK DlgProcContactOpts(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: HWND hwndList = GetDlgItem(hwnd, IDC_LIST); - for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (auto &hContact : contact_iter()) { HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0); for (int i = 0; i < 4 /*_countof(sttIcons)*/; ++i) { if (SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, 0))) { -- cgit v1.2.3