Bug 407030

Summary: Mass renaming fails to properly handle items which will themselves be renamed
Product: [Applications] dolphin Reporter: Joe Dight <joe.dight>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: amdev1, elvis.angelaccio, nate
Priority: NOR    
Version First Reported In: 18.12.2   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Joe Dight 2019-04-28 21:05:29 UTC
SUMMARY
When mass renaming with dolphin, if an file (or folder) is to be renamed to the name of an existing file, if that file is also being renamed, dolphin will still ask to overwrite that file (potentially leaving multiple copies of the same file).

STEPS TO REPRODUCE
1. Create two folders, 0 and 1, in an empty folder
2. Select both and right-click -> rename
3. Enter # into the rename pattern box, and 1 as the initial number.

OBSERVED RESULT
Dolphin will warn that the folder 1 already exists, and ask you if you want to write 0 into 1 or cancel. If you write into, then the directories are merged, then the directory 1 is renamed to 2, leaving you with one directory, 2.

EXPECTED RESULT
0 should be renamed to 1, and 1 renamed to 2, but without at any time writing both directories to the same path.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.15.4
KDE Frameworks Version: 5.55.0
Qt Version: 5.12.1

ADDITIONAL INFORMATION
Comment 1 Alex 2019-10-25 04:08:22 UTC
This happens because of the order in which files are renamed. So 0, 1 -> 1, 2 doesn't work as expected, but 1, 2 -> 0, 1 does.

I can't think of any way to fix this within Dolphin properly, KIO deals with the batch renaming.