summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2012-07-19 16:53:36 +0000
committerRobert Pösel <robyer@seznam.cz>2012-07-19 16:53:36 +0000
commit3da4dd40a5437548bc4e089b85e4fa4cdfb8b728 (patch)
tree9410472031a70e0e63fac4450f97f5f737c7acf5 /plugins
parenta9ba612fe47112bd476fbc42a1f232097e993b60 (diff)
clist_modern - another compatibility fix for old search.
git-svn-id: http://svn.miranda-ng.org/main/trunk@1044 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp1
-rw-r--r--plugins/Clist_modern/src/modern_clcutils.cpp33
2 files changed, 19 insertions, 15 deletions
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index b077a3df59..d1acc918fa 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -760,7 +760,6 @@ int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, struc
if (dat->filterSearch && dat->szQuickSearch) {
// search filtering
- //return _tcsnicmp(dat->szQuickSearch, pdnce->tszName, lstrlen(dat->szQuickSearch));
return _tcsstr(CharLowerW(pdnce->tszName), CharLowerW(dat->szQuickSearch)) ? 0 : 1;
}
if (g_CluiData.bMetaAvail && dat != NULL && dat->IsMetaContactsEnabled && g_szMetaModuleName && db_get_b(hContact, g_szMetaModuleName, "IsSubcontact", 0))
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp
index 4fb314fb12..ef1c374536 100644
--- a/plugins/Clist_modern/src/modern_clcutils.cpp
+++ b/plugins/Clist_modern/src/modern_clcutils.cpp
@@ -822,13 +822,15 @@ int cliFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int pref
contact = group->cl.items[group->scanIndex];
if (contact->type != CLCIT_DIVIDER)
{
- TCHAR* lowered = CharLowerW(NEWTSTR_ALLOCA(contact->szText));
- TCHAR* lowered_text = CharLowerW(NEWTSTR_ALLOCA(text));
- if (_tcsstr(lowered, lowered_text))
-
- /*if ((prefixOk && !_tcsnicmp(text, contact->szText, testlen)) ||
- (!prefixOk && !lstrcmpi(text, contact->szText))) */
- {
+ bool found;
+ if (dat->filterSearch) {
+ TCHAR *lowered_szText = CharLowerW(NEWTSTR_ALLOCA(contact->szText));
+ TCHAR *lowered_text = CharLowerW(NEWTSTR_ALLOCA(text));
+ found = _tcsstr(lowered_szText, lowered_text) != NULL;
+ } else {
+ found = (prefixOk && !_tcsnicmp(text, contact->szText, testlen)) || (!prefixOk && !lstrcmpi(text, contact->szText));
+ }
+ if (found) {
struct ClcGroup *contactGroup = group;
int contactScanIndex = group->scanIndex;
for (; group; group = group->parent)
@@ -853,13 +855,16 @@ int cliFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int pref
for (i=0; i < contact->SubAllocated; i++)
{
struct ClcContact * subcontact = &(contact->subcontacts[i]);
-
- TCHAR* lowered = CharLowerW(NEWTSTR_ALLOCA(subcontact->szText));
- TCHAR* lowered_text = CharLowerW(NEWTSTR_ALLOCA(text));
- if (_tcsstr(lowered, lowered_text))
-/* if ((prefixOk && !_tcsnicmp(text, subcontact->szText, testlen)) ||
- (!prefixOk && !lstrcmpi(text, subcontact->szText))) */
- {
+
+ bool found;
+ if (dat->filterSearch) {
+ TCHAR *lowered_szText = CharLowerW(NEWTSTR_ALLOCA(subcontact->szText));
+ TCHAR *lowered_text = CharLowerW(NEWTSTR_ALLOCA(text));
+ found = _tcsstr(lowered_szText, lowered_text) != NULL;
+ } else {
+ found = (prefixOk && !_tcsnicmp(text, subcontact->szText, testlen)) || (!prefixOk && !lstrcmpi(text, subcontact->szText));
+ }
+ if (found) {
struct ClcGroup *contactGroup = group;
int contactScanIndex = group->scanIndex;
for (; group; group = group->parent)