diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-19 18:18:58 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-19 18:18:58 +0000 |
commit | 405f1a1f9238fa24f749350a762695ad6e42361f (patch) | |
tree | 8ba5261aaae505bc2d6a006de384c17d54eb72d7 /src/modules/clist/clc.cpp | |
parent | c9a9db42fc216d6106e09def83a295c77ce080ab (diff) |
quick search code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@1049 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/clist/clc.cpp')
-rw-r--r-- | src/modules/clist/clc.cpp | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp index 4097f5a0f3..49b8dd6870 100644 --- a/src/modules/clist/clc.cpp +++ b/src/modules/clist/clc.cpp @@ -738,15 +738,11 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, case VK_END: dat->selection = cli.pfnGetGroupContentsCount(&dat->list, 1) - 1; selMoved = 1; break;
case VK_LEFT: changeGroupExpand = 1; break;
case VK_RIGHT: changeGroupExpand = 2; break;
- case VK_RETURN: cli.pfnDoSelectionDefaultAction(hwnd, dat);
- // TODO: clear filtering here somehow?
- /*if (dat->filterSearch) {
- dat->szQuickSearch[0] = 0;
+ case VK_RETURN:
+ cli.pfnDoSelectionDefaultAction(hwnd, dat);
+ dat->szQuickSearch[0] = 0;
+ if (dat->filterSearch)
cli.pfnSaveStateAndRebuildList(hwnd, dat);
- //cli.pfnRebuildEntireList(hwnd, dat);
- } else {
- dat->szQuickSearch[0] = 0;
- }*/
return 0;
case VK_F2: cli.pfnBeginRenameSelection(hwnd, dat); return 0;
case VK_DELETE: cli.pfnDeleteFromContactList(hwnd, dat); return 0;
@@ -766,11 +762,8 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, int hit;
ClcContact *contact;
ClcGroup *group;
- if (dat->filterSearch) {
- // this shouldn't clear filtering, but it should refresh highlighting somehow?
- } else {
+ if (!dat->filterSearch)
dat->szQuickSearch[0] = 0;
- }
hit = cli.pfnGetRowByIndex(dat, dat->selection, &contact, &group);
if (hit != -1) {
if (changeGroupExpand == 1 && contact->type == CLCIT_CONTACT) {
@@ -1237,11 +1230,6 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, cli.pfnHideInfoTip(hwnd, dat);
KillTimer(hwnd, TIMERID_RENAME);
KillTimer(hwnd, TIMERID_INFOTIP);
- if (dat->filterSearch) {
- // this should remove filtering (same as pressing ENTER)?
- } else {
- dat->szQuickSearch[0] = 0;
- }
dat->selection = cli.pfnHitTest(hwnd, dat, (short) LOWORD(lParam), (short) HIWORD(lParam), &contact, NULL, &hitFlags);
cli.pfnInvalidateRect(hwnd, NULL, FALSE);
if (dat->selection != -1)
@@ -1250,6 +1238,9 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, break;
UpdateWindow(hwnd);
cli.pfnDoSelectionDefaultAction(hwnd, dat);
+ dat->szQuickSearch[0] = 0;
+ if (dat->filterSearch)
+ cli.pfnSaveStateAndRebuildList(hwnd, dat);
break;
}
case WM_CONTEXTMENU:
|