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/clcutils.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/clcutils.cpp')
-rw-r--r-- | src/modules/clist/clcutils.cpp | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp index 6323d4c863..dc3acdfe9e 100644 --- a/src/modules/clist/clcutils.cpp +++ b/src/modules/clist/clcutils.cpp @@ -369,21 +369,28 @@ int fnFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int prefi continue;
}
if (group->cl.items[group->scanIndex]->type != CLCIT_DIVIDER) {
- if ((prefixOk && !_tcsnicmp(text, group->cl.items[group->scanIndex]->szText, testlen)) ||
- ( !prefixOk && !lstrcmpi(text, group->cl.items[group->scanIndex]->szText))) {
- ClcGroup *contactGroup = group;
- int contactScanIndex = group->scanIndex;
- for (; group; group = group->parent)
- cli.pfnSetGroupExpand(hwnd, dat, group, 1);
- return cli.pfnGetRowsPriorTo(&dat->list, contactGroup, contactScanIndex);
- }
- if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) {
- if ( !(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || group->cl.items[group->scanIndex]->group->expanded) {
- group = group->cl.items[group->scanIndex]->group;
- group->scanIndex = 0;
- continue;
- }
+ bool show;
+ if (dat->filterSearch) {
+ TCHAR *lowered_szText = CharLowerW(NEWTSTR_ALLOCA(group->cl.items[group->scanIndex]->szText));
+ TCHAR *lowered_text = CharLowerW(NEWTSTR_ALLOCA(text));
+ show = _tcsstr(lowered_szText, lowered_text) != NULL;
+ }
+ else show = ((prefixOk && !_tcsnicmp(text, group->cl.items[group->scanIndex]->szText, testlen)) || ( !prefixOk && !lstrcmpi(text, group->cl.items[group->scanIndex]->szText)));
+
+ if (show) {
+ ClcGroup *contactGroup = group;
+ int contactScanIndex = group->scanIndex;
+ for (; group; group = group->parent)
+ cli.pfnSetGroupExpand(hwnd, dat, group, 1);
+ return cli.pfnGetRowsPriorTo(&dat->list, contactGroup, contactScanIndex);
+ }
+ if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) {
+ if ( !(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || group->cl.items[group->scanIndex]->group->expanded) {
+ group = group->cl.items[group->scanIndex]->group;
+ group->scanIndex = 0;
+ continue;
}
+ }
}
group->scanIndex++;
}
|