mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
[PowerRename] Add PowerRename to directory background context menu (#24522)
* Add PowerRename to directory background context menu * Fix analyzer error * Add more checks
This commit is contained in:
@@ -93,12 +93,6 @@ public:
|
||||
{
|
||||
*cmdState = ECS_ENABLED;
|
||||
|
||||
// We've observed that it's possible that a null gets passed instead of an empty array. Just don't show the context menu in this case.
|
||||
if (nullptr == selection) {
|
||||
*cmdState = ECS_HIDDEN;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (!CSettingsInstance().GetEnabled())
|
||||
{
|
||||
*cmdState = ECS_HIDDEN;
|
||||
@@ -112,6 +106,12 @@ public:
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// When right clicking directory background, selection is empty. This prevents checking if there
|
||||
// are renamable items, but internal PowerRename logic will prevent renaming non-renamable items anyway.
|
||||
if (nullptr == selection) {
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// Check if at least one of the selected items is actually renamable.
|
||||
if (!ShellItemArrayContainsRenamableItem(selection))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user