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_nicer/src/viewmodes.cpp | |
parent | 5046973a41e412afd06d6a78a3b9bce226e3cf50 (diff) |
always hated these long expressions: contact_iter makes them much shorter
Diffstat (limited to 'plugins/Clist_nicer/src/viewmodes.cpp')
-rw-r--r-- | plugins/Clist_nicer/src/viewmodes.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index 61c058a65d..01c19789a5 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -134,7 +134,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(sttClvmHwnd, IDC_CLIST, CLM_FINDCONTACT, hContact, 0);
if (hItem)
SendDlgItemMessage(sttClvmHwnd, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, db_get_b(hContact, "CLVM", sttModeName, 0) ? 1 : 0);
@@ -374,7 +374,7 @@ void SaveState() DWORD dwGlobalMask = GetMaskForItem(hInfoItem);
unsigned int stickies = 0;
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (auto &hContact : contact_iter()) {
HANDLE hItem = (HANDLE)SendDlgItemMessage(sttClvmHwnd, IDC_CLIST, CLM_FINDCONTACT, hContact, 0);
if (hItem) {
if (SendDlgItemMessage(sttClvmHwnd, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) {
@@ -652,7 +652,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
SetWindowText(hwndSelector, TranslateT("No view mode"));
}
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (auto &hContact : contact_iter())
if (db_get_dw(hContact, "CLVM", szBuf, -1) != -1)
db_set_dw(hContact, "CLVM", szBuf, 0);
@@ -695,7 +695,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP break;
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);
|