summaryrefslogtreecommitdiff
path: root/plugins/Sessions/Src/Options.cpp
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/Sessions/Src/Options.cpp
parent5046973a41e412afd06d6a78a3b9bce226e3cf50 (diff)
always hated these long expressions: contact_iter makes them much shorter
Diffstat (limited to 'plugins/Sessions/Src/Options.cpp')
-rw-r--r--plugins/Sessions/Src/Options.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/Sessions/Src/Options.cpp b/plugins/Sessions/Src/Options.cpp
index cfc378ff6e..f19d90c1e1 100644
--- a/plugins/Sessions/Src/Options.cpp
+++ b/plugins/Sessions/Src/Options.cpp
@@ -46,7 +46,7 @@ int OpLoadSessionContacts(WPARAM, LPARAM lparam)
{
memset(session_list_t, 0, sizeof(session_list_t));
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (auto &hContact : contact_iter()) {
if (LoadContactsFromMask(hContact, 1, lparam)) {
int i = GetInSessionOrder(hContact, 1, lparam);
session_list_t[i] = hContact;
@@ -314,7 +314,7 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l
if (!hOpClistControl)
EnableWindow(GetDlgItem(hdlg, IDC_DEL), TRUE);
else {
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (auto &hContact : contact_iter())
SendMessage(hOpClistControl, CLM_SETCHECKMARK, hContact, 0);
for (int i = 0; session_list_t[i] > 0; i++) {
@@ -361,7 +361,7 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l
case IDC_SAVE:
{
int i = 0;
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (auto &hContact : contact_iter()) {
BYTE res = (BYTE)SendDlgItemMessage(hdlg, IDC_EMCLIST, CLM_GETCHECKMARK,
SendDlgItemMessage(hdlg, IDC_EMCLIST, CLM_FINDCONTACT, hContact, 0), 0);
if (res) {