From d56c47c3ca87277d6473945d06afcaac55f38379 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 26 Feb 2016 18:55:53 +0000 Subject: no need to readd contact being removed to a cache git-svn-id: http://svn.miranda-ng.org/main/trunk@16351 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/modern_clcitems.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'plugins/Clist_modern/src') diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index 7745883c2d..ea1a517577 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -272,15 +272,21 @@ void cli_AddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int update _LoadDataToContact(cont, group, dat, hContact); } -void cli_DeleteItemFromTree(HWND hwnd, MCONTACT hItem) +void cli_DeleteItemFromTree(HWND hwnd, MCONTACT hContact) { ClcData *dat = (ClcData *)GetWindowLongPtr(hwnd, 0); ClearRowByIndexCache(); - corecli.pfnDeleteItemFromTree(hwnd, hItem); + corecli.pfnDeleteItemFromTree(hwnd, hContact); // check here contacts are not resorting - if (hwnd == pcli->hwndContactTree) - pcli->pfnFreeCacheItem(pcli->pfnGetCacheEntry(hItem)); + if (hwnd == pcli->hwndContactTree) { + int idx = clistCache.getIndex((ClcCacheEntry*)&hContact); + if (idx != -1) { + pcli->pfnFreeCacheItem(clistCache[idx]); + clistCache.remove(idx); + } + } + dat->needsResort = 1; ClearRowByIndexCache(); } -- cgit v1.2.3