mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 12:18:50 +02:00
[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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user