[PowerRename] Cleanup and fix for renaming to empty string (#19691)

* Add UI items using OnItemAdded callback

* Simplify ToggleAll() logic

* Simplify items' Checkbox logic

* Do not allow renaming to empty string

* Simplify ShowAll/ShowRenamed logic

* Simplify rename button logic
This commit is contained in:
Stefan Markovic
2022-08-05 19:14:53 +02:00
committed by GitHub
parent 6ef439bda4
commit 1fe9d95322
7 changed files with 56 additions and 153 deletions

View File

@@ -195,7 +195,7 @@ IFACEMETHODIMP CPowerRenameItem::ShouldRenameItem(_In_ DWORD flags, _Out_ bool*
{
// Should we perform a rename on this item given its
// state and the options that were set?
bool hasChanged = m_newName != nullptr && (lstrcmp(m_originalName, m_newName) != 0);
bool hasChanged = m_newName != nullptr && (lstrcmp(m_originalName, m_newName) != 0) && (lstrcmp(L"", m_newName) != 0);
bool excludeBecauseFolder = (m_isFolder && (flags & PowerRenameFlags::ExcludeFolders));
bool excludeBecauseFile = (!m_isFolder && (flags & PowerRenameFlags::ExcludeFiles));
bool excludeBecauseSubFolderContent = (m_depth > 0 && (flags & PowerRenameFlags::ExcludeSubfolders));