https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2f6f24d0f6d31d29dd9ff…
commit 2f6f24d0f6d31d29dd9ff3df258262535480de00
Author: Atharva Kulkarni <atharvak1910(a)gmail.com>
AuthorDate: Tue Feb 14 01:19:45 2023 +0530
Commit: GitHub <noreply(a)github.com>
CommitDate: Mon Feb 13 20:49:45 2023 +0100
[BROWSEUI] Don't show file names in Relevance column in search results (#5072)
* Dont show file names in Relevance column
* Define new column names
* Update CompareIDs to use newer defines
---
dll/win32/browseui/resource.h | 4 ++++
dll/win32/browseui/shellfind/CFindFolder.cpp | 14 ++++++++++----
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/dll/win32/browseui/resource.h b/dll/win32/browseui/resource.h
index 8b4318ffcb4..9a80d85e045 100644
--- a/dll/win32/browseui/resource.h
+++ b/dll/win32/browseui/resource.h
@@ -180,3 +180,7 @@
#define IDS_PARSE_ADDR_ERR_TITLE 9600
#define IDS_PARSE_ADDR_ERR_TEXT 9601
+
+#define COL_NAME_INDEX 0
+#define COL_LOCATION_INDEX 1
+#define COL_RELEVANCE_INDEX 2
diff --git a/dll/win32/browseui/shellfind/CFindFolder.cpp
b/dll/win32/browseui/shellfind/CFindFolder.cpp
index 63ff66247c4..faa71f4c528 100644
--- a/dll/win32/browseui/shellfind/CFindFolder.cpp
+++ b/dll/win32/browseui/shellfind/CFindFolder.cpp
@@ -671,11 +671,17 @@ STDMETHODIMP CFindFolder::GetDetailsOf(PCUITEMID_CHILD pidl, UINT
iColumn, SHELL
if (!pidl)
return SHSetStrRet(&pDetails->str, _AtlBaseModule.GetResourceInstance(),
g_ColumnDefs[iColumn].iResource);
- if (iColumn == 1)
+ if (iColumn == COL_LOCATION_INDEX)
{
return SHSetStrRet(&pDetails->str, _ILGetPath(pidl));
}
+ if (iColumn == COL_RELEVANCE_INDEX)
+ {
+ // TODO: Fill once the relevance is calculated
+ return SHSetStrRet(&pDetails->str, "");
+ }
+
return GetDisplayNameOf(pidl, SHGDN_NORMAL, &pDetails->str);
}
@@ -716,11 +722,11 @@ STDMETHODIMP CFindFolder::CompareIDs(LPARAM lParam,
PCUIDLIST_RELATIVE pidl1, PC
WORD wColumn = LOWORD(lParam);
switch (wColumn)
{
- case 0: // Name
+ case COL_NAME_INDEX: // Name
break;
- case 1: // Path
+ case COL_LOCATION_INDEX: // Path
return MAKE_COMPARE_HRESULT(StrCmpW(_ILGetPath(pidl1), _ILGetPath(pidl2)));
- case 2: // Relevance
+ case COL_RELEVANCE_INDEX: // Relevance
return E_NOTIMPL;
default: // Default columns
wColumn -= _countof(g_ColumnDefs) - 1;