diff options
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(); } |