[PowerRename] Add Filtering Feature (#6017)

* Implement basic functionality

* Change approach.
move filter controls to manager
edit redrawing to always work with new GetVisibleItemCount() and GetVisibleItemByIndex() calls

* Fix performance issues. Some refactoring.

* Handle toggleAll correctly

* Handle dangling elements when filter is on

Make an item visible if it has at least one visible subitem

* Support filtering for selected and shouldRename

* Refactor for readability, remove useless member from PowerRenameUI

* Change variable names in PowerRenameUI for clarity

Use wrapper function RedrawItems() and SetItemCount() for consistency

* Handle result value properly in getVisibleItemByIndex()

* Add FlagsApplicable filter

* Add visual indication of filters

* Improve performance

Check if no filter is selected
Call SetItemCount() only when necessary

* Refactor for readability

* Get lock in setVisible()

* Change function names to camel case

* Change function names to start with uppercase

* Change filter behaviour when search area is empty

Show all elements when search area is empty and ShouldRename filter is selected
Avoid warnings

* Resolve conflicts
This commit is contained in:
Mehmet Murat Akburak
2020-08-25 08:22:05 +03:00
committed by GitHub
parent 3ede1a0b53
commit d3b80b26e3
14 changed files with 460 additions and 199 deletions

View File

@@ -307,21 +307,21 @@ HRESULT _ParseEnumItems(_In_ IEnumShellItems* pesi, _In_ IPowerRenameManager* ps
while ((S_OK == pesi->Next(1, &spsi, &celtFetched)) && (SUCCEEDED(hr)))
{
CComPtr<IPowerRenameItemFactory> spsrif;
hr = psrm->get_renameItemFactory(&spsrif);
hr = psrm->GetRenameItemFactory(&spsrif);
if (SUCCEEDED(hr))
{
CComPtr<IPowerRenameItem> spNewItem;
hr = spsrif->Create(spsi, &spNewItem);
if (SUCCEEDED(hr))
{
spNewItem->put_depth(depth);
spNewItem->PutDepth(depth);
hr = psrm->AddItem(spNewItem);
}
if (SUCCEEDED(hr))
{
bool isFolder = false;
if (SUCCEEDED(spNewItem->get_isFolder(&isFolder)) && isFolder)
if (SUCCEEDED(spNewItem->GetIsFolder(&isFolder)) && isFolder)
{
// Bind to the IShellItem for the IEnumShellItems interface
CComPtr<IEnumShellItems> spesiNext;