From d35fdfd4681f12a616ce51eb820e960469039e74 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 16 Apr 2025 19:35:37 +0300 Subject: also restored old code for group's deletion --- src/mir_app/src/clistgroups.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/mir_app/src/clistgroups.cpp b/src/mir_app/src/clistgroups.cpp index 41778fda45..e6547cd2f1 100644 --- a/src/mir_app/src/clistgroups.cpp +++ b/src/mir_app/src/clistgroups.cpp @@ -257,10 +257,12 @@ MIR_APP_DLL(int) Clist_GroupDelete(MGROUP hGroup, bool bSilent) for (auto &it : arByIds) it->oldId = it->groupId; + int iGap = 0; for (auto &it : arByIds.rev_iter()) { if (!isParentOf(wszOldName, it->groupName)) continue; + iGap++; arByName.remove(it); arByIds.removeItem(&it); } @@ -271,6 +273,12 @@ MIR_APP_DLL(int) Clist_GroupDelete(MGROUP hGroup, bool bSilent) it->save(); } + for (int i = 0; i < iGap; i++) { + char idstr[33]; + _itoa(arByIds.getCount() + i, idstr, 10); + db_unset(0, GROUPS_MODULE, idstr); + } + SetCursor(LoadCursor(nullptr, IDC_ARROW)); Clist_LoadContactTree(); Clist_BroadcastAsync(INTM_GROUPSCHANGED, 0, 0); -- cgit v1.2.3