From 2b15611f3f55ac8632198ffc380e3d79640d252a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 21 Sep 2016 10:06:08 +0000 Subject: fixed nasty bug in groups' cache coherence git-svn-id: http://svn.miranda-ng.org/main/trunk@17329 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_app/src/clistgroups.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/clistgroups.cpp b/src/mir_app/src/clistgroups.cpp index 524f91b9f0..dc5ed18927 100644 --- a/src/mir_app/src/clistgroups.cpp +++ b/src/mir_app/src/clistgroups.cpp @@ -309,11 +309,11 @@ MIR_APP_DLL(int) Clist_GroupMoveBefore(MGROUP hGroup, MGROUP hGroupBefore) pGroup->groupId = hGroupBefore; // reinsert group back pGroup->save(); - arByIds.insert(pGroup); + g_bGroupsLocked = false; Clist_BroadcastAsync(CLM_AUTOREBUILD, 0, 0); - return shuffleTo + 1; + return hGroupBefore + 1; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -331,13 +331,15 @@ static int RenameGroupWithMove(int groupId, const wchar_t *szName, int move) // do the change wchar_t *oldName = NEWWSTR_ALLOCA(pGroup->groupName+1); + arByName.remove(pGroup); wchar_t str[256]; str[0] = pGroup->groupName[0]; mir_wstrncpy(str + 1, szName, _countof(str) - 1); - pGroup->groupName = mir_wstrdup(str); + replaceStrW(pGroup->groupName, str); pGroup->save(); + arByName.insert(pGroup); // must rename setting in all child contacts too for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { -- cgit v1.2.3