diff options
author | George Hazan <george.hazan@gmail.com> | 2016-05-20 10:40:38 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-05-20 10:40:38 +0000 |
commit | 5b55ebfcc6a6835c17b90bebcf4395b82b937d04 (patch) | |
tree | 3c9ec25667ed5a8df32e472c26d94995bbe2c4e7 /src/mir_app | |
parent | c44d4835faed14e31a1e531537c30398ce9e7e0c (diff) |
fixes #1242 (Clist_modern's cache changes related bugs)
git-svn-id: http://svn.miranda-ng.org/main/trunk@16857 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/src/clc.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index 7a5b558588..fd34ede385 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -64,6 +64,11 @@ void fnClcOptionsChanged(void) static int ClcSettingChanged(WPARAM hContact, LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *)lParam;
+ if (hContact == NULL) {
+ if (!strcmp(cws->szModule, "CListGroups"))
+ cli.pfnClcBroadcast(INTM_GROUPSCHANGED, hContact, lParam);
+ return 0;
+ }
if (!strcmp(cws->szModule, "CList")) {
if (!strcmp(cws->szSetting, "MyHandle")) {
@@ -370,6 +375,55 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam case WM_GETFONT:
return (LRESULT)dat->fontInfo[FONTID_CONTACTS].hFont;
+ case INTM_GROUPSCHANGED:
+ {
+ DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING *)lParam;
+ if (dbcws->value.type == DBVT_ASCIIZ || dbcws->value.type == DBVT_UTF8) {
+ int groupId = atoi(dbcws->szSetting) + 1;
+ TCHAR szFullName[512];
+ int i, eq;
+ //check name of group and ignore message if just being expanded/collapsed
+ if (cli.pfnFindItem(hwnd, dat, groupId | HCONTACT_ISGROUP, &contact, &group, NULL)) {
+ mir_tstrcpy(szFullName, contact->szText);
+ while (group->parent) {
+ for (i = 0; i < group->parent->cl.count; i++)
+ if (group->parent->cl.items[i]->group == group)
+ break;
+ if (i == group->parent->cl.count) {
+ szFullName[0] = '\0';
+ break;
+ }
+ group = group->parent;
+ size_t nameLen = mir_tstrlen(group->cl.items[i]->szText);
+ if (mir_tstrlen(szFullName) + 1 + nameLen > _countof(szFullName)) {
+ szFullName[0] = '\0';
+ break;
+ }
+ memmove(szFullName + 1 + nameLen, szFullName, sizeof(TCHAR)*(mir_tstrlen(szFullName) + 1));
+ memcpy(szFullName, group->cl.items[i]->szText, sizeof(TCHAR)*nameLen);
+ szFullName[nameLen] = '\\';
+ }
+
+ if (dbcws->value.type == DBVT_ASCIIZ) {
+ WCHAR* wszGrpName = mir_a2u(dbcws->value.pszVal + 1);
+ eq = !mir_tstrcmp(szFullName, wszGrpName);
+ mir_free(wszGrpName);
+ }
+ else {
+ char* szGrpName = NEWSTR_ALLOCA(dbcws->value.pszVal + 1);
+ WCHAR* wszGrpName;
+ Utf8Decode(szGrpName, &wszGrpName);
+ eq = !mir_tstrcmp(szFullName, wszGrpName);
+ mir_free(wszGrpName);
+ }
+ if (eq && (contact->group->hideOffline != 0) == ((dbcws->value.pszVal[0] & GROUPF_HIDEOFFLINE) != 0))
+ break; //only expanded has changed: no action reqd
+ }
+ }
+ cli.pfnSaveStateAndRebuildList(hwnd, dat);
+ }
+ break;
+
case INTM_NAMEORDERCHANGED:
cli.pfnInitAutoRebuild(hwnd);
break;
|