summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-05-28 09:39:09 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-05-28 09:39:09 +0000
commit3a80b03cb1b3813b47fa878fae9a61632bd25d51 (patch)
tree06e7572273baf8029e493381316600c8ba81db2a /src
parent22d42330716a38bfe2faef08eec2b2d3cab1886d (diff)
duplicated code removed from clist_nicer
git-svn-id: http://svn.miranda-ng.org/main/trunk@16879 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/clcitems.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mir_app/src/clcitems.cpp b/src/mir_app/src/clcitems.cpp
index 9408a40320..be581876eb 100644
--- a/src/mir_app/src/clcitems.cpp
+++ b/src/mir_app/src/clcitems.cpp
@@ -339,11 +339,11 @@ void fnDeleteItemFromTree(HWND hwnd, MCONTACT hItem)
void fnRebuildEntireList(HWND hwnd, ClcData *dat)
{
DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
- ClcGroup *group;
dat->list.expanded = 1;
- dat->list.hideOffline = db_get_b(NULL, "CLC", "HideOfflineRoot", 0) && style&CLS_USEGROUPS;
+ dat->list.hideOffline = db_get_b(NULL, "CLC", "HideOfflineRoot", 0) && (style & CLS_USEGROUPS);
dat->list.cl.destroy();
+ dat->list.totalMembers = 0;
dat->selection = -1;
for (int i = 1;; i++) {
@@ -356,13 +356,14 @@ void fnRebuildEntireList(HWND hwnd, ClcData *dat)
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (style & CLS_SHOWHIDDEN || !db_get_b(hContact, "CList", "Hidden", 0)) {
- DBVARIANT dbv;
- if (db_get_ts(hContact, "CList", "Group", &dbv))
- group = &dat->list;
+ ClcGroup *group;
+ ptrT tszGroupName(db_get_tsa(hContact, "CList", "Group"));
+ if (tszGroupName == NULL)
+ group = &dat->list;
else {
- group = cli.pfnAddGroup(hwnd, dat, dbv.ptszVal, (DWORD)-1, 0, 0);
- if (group == NULL && style & CLS_SHOWHIDDEN) group = &dat->list;
- mir_free(dbv.ptszVal);
+ group = cli.pfnAddGroup(hwnd, dat, tszGroupName, (DWORD)-1, 0, 0);
+ if (group == NULL && style & CLS_SHOWHIDDEN)
+ group = &dat->list;
}
if (group != NULL) {
@@ -391,7 +392,7 @@ void fnRebuildEntireList(HWND hwnd, ClcData *dat)
}
if (style & CLS_HIDEEMPTYGROUPS) {
- group = &dat->list;
+ ClcGroup *group = &dat->list;
group->scanIndex = 0;
for (;;) {
if (group->scanIndex == group->cl.getCount()) {