diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-01 12:55:27 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-01 12:55:27 +0000 |
commit | 6d99149365c5b279127644bfc12e76f800c806f3 (patch) | |
tree | a22cc2cbe138faea10c7f915baefcad50fcb4e9a /src/modules/clist | |
parent | 393b989dd82764b10152c06a51d77d27550ccd8e (diff) |
code simplification
git-svn-id: http://svn.miranda-ng.org/main/trunk@2128 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/clist')
-rw-r--r-- | src/modules/clist/clcitems.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp index 0530f75fb8..149017d8f7 100644 --- a/src/modules/clist/clcitems.cpp +++ b/src/modules/clist/clcitems.cpp @@ -292,27 +292,19 @@ ClcGroup* fnRemoveItemFromGroup(HWND hwnd, ClcGroup *group, ClcContact *contact, group->totalMembers--;
ClcCacheEntry *p = cli.pfnGetCacheEntry(contact->hContact);
- if (p != NULL) {
- if (p->tszGroup) mir_free(p->tszGroup);
- p->tszGroup = NULL;
- }
+ if (p != NULL)
+ replaceStrT(p->tszGroup, NULL);
}
cli.pfnFreeContact(group->cl.items[iContact]);
mir_free(group->cl.items[iContact]);
List_Remove((SortedList*)&group->cl, iContact);
- if ((GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) && group->cl.count == 0) {
- int i;
- if (group->parent == NULL)
- return group;
- for (i=0; i < group->parent->cl.count; i++)
+ if ((GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) && group->cl.count == 0 && group->parent != NULL)
+ for (int i=0; i < group->parent->cl.count; i++)
if (group->parent->cl.items[i]->type == CLCIT_GROUP && group->parent->cl.items[i]->groupId == group->groupId)
- break;
- if (i == group->parent->cl.count)
- return group; //never happens
- return cli.pfnRemoveItemFromGroup(hwnd, group->parent, group->parent->cl.items[i], 0);
- }
+ return cli.pfnRemoveItemFromGroup(hwnd, group->parent, group->parent->cl.items[i], 0);
+
return group;
}
|