summaryrefslogtreecommitdiff
path: root/src/modules/clist/clcutils.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-07-04 21:17:37 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-07-04 21:17:37 +0000
commite693f1d803f736478a30dd76c6748839796fca77 (patch)
treea98fa46db871e9edbf2f9ef4de566228daee299c /src/modules/clist/clcutils.cpp
parentf1bbd65bbaa4291c194244424668aa16c357ca0f (diff)
standardizing the control over checkboxes in clist
git-svn-id: http://svn.miranda-ng.org/main/trunk@9682 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/clist/clcutils.cpp')
-rw-r--r--src/modules/clist/clcutils.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp
index 470936f9e4..92ed6de693 100644
--- a/src/modules/clist/clcutils.cpp
+++ b/src/modules/clist/clcutils.cpp
@@ -818,22 +818,24 @@ void fnRecalculateGroupCheckboxes(HWND, struct ClcData *dat)
}
}
+void fnSetContactCheckboxes(ClcContact *cc, int checked)
+{
+ if (checked)
+ cc->flags |= CONTACTF_CHECKED;
+ else
+ cc->flags &= ~CONTACTF_CHECKED;
+}
+
void fnSetGroupChildCheckboxes(ClcGroup *group, int checked)
{
for (int i=0; i < group->cl.count; i++) {
- if (group->cl.items[i]->type == CLCIT_GROUP) {
- cli.pfnSetGroupChildCheckboxes(group->cl.items[i]->group, checked);
- if (checked)
- group->cl.items[i]->flags |= CONTACTF_CHECKED;
- else
- group->cl.items[i]->flags &= ~CONTACTF_CHECKED;
- }
- else if (group->cl.items[i]->type == CLCIT_CONTACT) {
- if (checked)
- group->cl.items[i]->flags |= CONTACTF_CHECKED;
- else
- group->cl.items[i]->flags &= ~CONTACTF_CHECKED;
+ ClcContact *cc = group->cl.items[i];
+ if (cc->type == CLCIT_GROUP) {
+ cli.pfnSetGroupChildCheckboxes(cc->group, checked);
+ cli.pfnSetContactCheckboxes(cc, checked);
}
+ else if (cc->type == CLCIT_CONTACT)
+ cli.pfnSetContactCheckboxes(cc, checked);
}
}