[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
This commit is contained in:
Atharva Kulkarni 2023-02-14 01:19:45 +05:30 committed by GitHub
parent a777cc2cc4
commit 2f6f24d0f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View file

@ -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

View file

@ -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;