summaryrefslogtreecommitdiff
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
parenta134962a8ac19a0013e9dec8d747eca455525946 (diff)
no need to rebuild the whole clist if the search window is empty
-rw-r--r--include/m_clistint.h1
-rw-r--r--libs/win32/mir_app.libbin111418 -> 111648 bytes
-rw-r--r--libs/win64/mir_app.libbin106878 -> 107088 bytes
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp4
-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
7 files changed, 14 insertions, 9 deletions
diff --git a/include/m_clistint.h b/include/m_clistint.h
index c2c2906882..ba542dd915 100644
--- a/include/m_clistint.h
+++ b/include/m_clistint.h
@@ -250,6 +250,7 @@ EXTERN_C MIR_APP_DLL(HANDLE) Clist_ContactToItemHandle(ClcContact *contact, DWOR
EXTERN_C MIR_APP_DLL(void) Clist_Broadcast(int msg, WPARAM wParam, LPARAM lParam);
EXTERN_C MIR_APP_DLL(void) Clist_BroadcastAsync(int msg, WPARAM wParam, LPARAM lParam);
+EXTERN_C MIR_APP_DLL(void) Clist_ClearSearch(HWND hwnd, ClcData *dat);
EXTERN_C MIR_APP_DLL(bool) Clist_FindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible);
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib
index ae9a6a7c67..9867d9809c 100644
--- a/libs/win32/mir_app.lib
+++ b/libs/win32/mir_app.lib
Binary files differ
diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib
index ebbd20fc6d..ebdb8c3b3f 100644
--- a/libs/win64/mir_app.lib
+++ b/libs/win64/mir_app.lib
Binary files differ
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index 39236d404a..e2bf1a11ed 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -449,9 +449,7 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM
case VK_RETURN:
pcli->pfnDoSelectionDefaultAction(hwnd, dat);
SetCapture(hwnd);
- dat->szQuickSearch[0] = 0;
- if (dat->bFilterSearch)
- pcli->pfnSaveStateAndRebuildList(hwnd, dat);
+ Clist_ClearSearch(hwnd, dat);
return 0;
case VK_F2: cliBeginRenameSelection(hwnd, dat); /*SetCapture(hwnd);*/ return 0;
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