Bug 512352

Summary: Using batch rename to prepend text to folder names truncates names at the rightmost '.' character
Product: [Applications] dolphin Reporter: sammy <sam11120a>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: REPORTED ---    
Severity: normal CC: dolphin-bugs-null, stefan
Priority: NOR    
Version First Reported In: 25.08.3   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description sammy 2025-11-19 16:59:32 UTC
SUMMARY
Using Dolphin's "batch rename" feature to prepend text to folder names will truncate the resulting folder name at the rightmost '.' character.

STEPS TO REPRODUCE
1. In any directory, create multiple subfolders with names containing the '.' (period/full stop) character.
2. Select these folders and Right Click>Rename / press F2 to open the "Rename Items" dialog.
3. Select "Add text" under the "How to rename" dialog, choose "Before filename", and enter some text to prepend to the folder names.
4. Rename the items.

OBSERVED RESULT
Before Rename     | After add text "H " before filename
------------------|------------------------------------
1999-No Periods   | H 1999-No Periods
2000.Dr.John_Paul | H 2000.Dr
2001.Documents    | H 2001
Over 120.6        | H Over 120

EXPECTED RESULT
Before Rename     | After add text "H " before filename
------------------|------------------------------------
1999-No Periods   | H 1999-No Periods
2000.Dr.John_Paul | H 2000.Dr.John_Paul
2001.Documents    | H 2001.Documents
Over 120.6        | H Over 120.6

SOFTWARE/OS VERSIONS
(available in the Info Center app, or by running `kinfo` in a terminal window)
Output of `uname -a`: Linux hostname 6.12.58-1-lts #1 SMP PREEMPT_DYNAMIC Fri, 14 Nov 2025 05:38:58 +0000 x86_64 GNU/Linux
KDE Plasma Version: 6.5.3
KDE Frameworks Version: 6.20.0
Qt Version: 6.10.0

ADDITIONAL INFORMATION
If two folders that are identical before the first "." character (e.g. "2001.Photos" and "2001.Videos") are renamed in this way, the user will be asked to merge the contents of the two folders after pressing Rename in the Rename Items dialog.
Comment 1 amilias 2025-12-19 05:48:23 UTC
Can confirm this behavior, same thing happens with the "replace" option as well. 
If I were to guess I'd say it's a side effect of handling file extensions, since the batch rename dialog only works on names and tries to keep extensions the same, which of course makes no sense for folders. Also, there's an edge-case of renaming files without extensions which include "." somewhere in the middle, not sure if this should be considered seeing how there's probably no catch-all solution to this.