diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-16 20:01:14 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-16 20:01:14 +0300 |
commit | 39390b02dbd5aa7eb21a83773fa561b39f8828bc (patch) | |
tree | 7982eda1257f7466b5663c2865fdb7804c397257 /plugins/Clist_modern | |
parent | 5046973a41e412afd06d6a78a3b9bce226e3cf50 (diff) |
always hated these long expressions: contact_iter makes them much shorter
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r-- | plugins/Clist_modern/src/modern_viewmodebar.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index 9c50528e0d..3c9ea70dc1 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -174,7 +174,7 @@ static DWORD GetMaskForItem(HANDLE hItem) static void UpdateStickies()
{
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (auto &hContact : contact_iter()) {
MCONTACT hItem = (MCONTACT)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, hContact, 0);
if (hItem)
SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, (BYTE)db_get_dw(hContact, CLVM_MODULE, g_szModename, 0) ? 1 : 0);
@@ -432,7 +432,7 @@ void SaveState() T2Utf szModeName(szTempModeName);
DWORD dwGlobalMask = GetMaskForItem(hInfoItem);
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (auto &hContact : contact_iter()) {
HANDLE hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, hContact, 0);
if (hItem == nullptr)
continue;
@@ -624,7 +624,7 @@ void DeleteViewMode(char * szName) SetWindowText(hwndSelector, TranslateT("All contacts"));
}
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (auto &hContact : contact_iter())
if (db_get_dw(hContact, CLVM_MODULE, szName, -1) != -1)
db_set_dw(hContact, CLVM_MODULE, szName, 0);
}
@@ -793,7 +793,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
case IDC_CLEARALL:
{
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (auto &hContact : contact_iter()) {
HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0);
if (hItem)
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 0);
|