From caf290fb9b71267941a5d19a63dde6e8e93fab9e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 17 Mar 2017 17:43:21 +0300 Subject: no need to rebuild the whole clist if the search window is empty --- src/mir_app/src/clc.cpp | 16 ++++++++++------ src/mir_app/src/mir_app.def | 1 + src/mir_app/src/mir_app64.def | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index 77cd4f3e54..2f00997c80 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -48,6 +48,14 @@ void fnInitAutoRebuild(HWND hWnd) } } +MIR_APP_DLL(void) Clist_ClearSearch(HWND hwnd, ClcData *dat) +{ + bool bSearchExisted = dat->szQuickSearch[0] != 0; + dat->szQuickSearch[0] = 0; + if (dat->bFilterSearch && bSearchExisted) + cli.pfnSaveStateAndRebuildList(hwnd, dat); +} + MIR_APP_DLL(void) Clist_Broadcast(int msg, WPARAM wParam, LPARAM lParam) { WindowList_Broadcast(hClcWindowList, msg, wParam, lParam); @@ -699,9 +707,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam case VK_RIGHT: changeGroupExpand = 2; break; case VK_RETURN: cli.pfnDoSelectionDefaultAction(hwnd, dat); - dat->szQuickSearch[0] = 0; - if (dat->bFilterSearch) - cli.pfnSaveStateAndRebuildList(hwnd, dat); + Clist_ClearSearch(hwnd, dat); return 0; case VK_F2: cli.pfnBeginRenameSelection(hwnd, dat); return 0; case VK_DELETE: cli.pfnDeleteFromContactList(hwnd, dat); return 0; @@ -1176,9 +1182,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam UpdateWindow(hwnd); cli.pfnDoSelectionDefaultAction(hwnd, dat); - dat->szQuickSearch[0] = 0; - if (dat->bFilterSearch) - cli.pfnSaveStateAndRebuildList(hwnd, dat); + Clist_ClearSearch(hwnd, dat); break; case WM_CONTEXTMENU: diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index b542fe6fed..1d15af6551 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -425,3 +425,4 @@ _Srmm_ButtonSubclassProc@16 @423 NONAME ?RedrawLog2@CSrmmBaseDialog@@QAEXXZ @426 NONAME ?ScrollToBottom@CSrmmBaseDialog@@UAEXXZ @427 NONAME ?UpdateNickList@CSrmmBaseDialog@@UAEXXZ @428 NONAME +Clist_ClearSearch @429 NONAME diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index f23d42cb20..0802a90a7f 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -425,3 +425,4 @@ Srmm_ButtonSubclassProc @423 NONAME ?RedrawLog2@CSrmmBaseDialog@@QEAAXXZ @426 NONAME ?ScrollToBottom@CSrmmBaseDialog@@UEAAXXZ @427 NONAME ?UpdateNickList@CSrmmBaseDialog@@UEAAXXZ @428 NONAME +Clist_ClearSearch @429 NONAME -- cgit v1.2.3