diff options
author | George Hazan <george.hazan@gmail.com> | 2016-02-26 18:55:53 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-02-26 18:55:53 +0000 |
commit | d56c47c3ca87277d6473945d06afcaac55f38379 (patch) | |
tree | 8e5965d2fe570d8e64a594c581666816634e79db /plugins/Clist_modern/src | |
parent | 134773092963feea383ea315604bd1b996cdc6c5 (diff) |
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
Diffstat (limited to 'plugins/Clist_modern/src')
-rw-r--r-- | plugins/Clist_modern/src/modern_clcitems.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
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(); } |