summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-03-17 17:43:21 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-03-17 17:43:21 +0300
commitcaf290fb9b71267941a5d19a63dde6e8e93fab9e (patch)
tree5469e6a9794a40ede1fe7f5d2af7d53c3f388b06 /src
parenta134962a8ac19a0013e9dec8d747eca455525946 (diff)
no need to rebuild the whole clist if the search window is empty
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/clc.cpp16
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
3 files changed, 12 insertions, 6 deletions
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