https://bugs.kde.org/show_bug.cgi?id=510277
Bug ID: 510277
Summary: improvement of "makeSuggestedName" for hidden files in
unix-like OS
Classification: Frameworks and Libraries
Product: frameworks-kcoreaddons
Version First unspecified
Reported In:
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: general
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Target Milestone: ---
When duplicating a file or folder in the Dolphin file browser, the names are
currently chosen as follows:
Original file "abc.txt", first duplicate: "abc copy.txt", second duplicate:
"abc copy (1).txt"
Original file ".bashrc", first duplicate: ".bashrc copy", second duplicate: ".
(1).bashrc copy"
The name of the first duplicate is generated by Dolphin itself (in "void
DolphinView::duplicateSelectedItems()"), but the name of the second duplicate
is then generated by the KCoreAddons (in "QString
KFileUtils::makeSuggestedName(const QString &oldName)").
For "abc copy.txt" this looks ok, because all three files have the same prefix
and are next to each other when sorting files by name.
But for the hidden file ".bashrc", the name of the second duplicate has a
different prefix than the original file. The code does not seem to account for
a leading dot in hidden files and folders.
A suggested name ".bashrc copy (1)" for the second duplicate would be more
convenient, in my opinion.
Related code:
https://invent.kde.org/frameworks/kcoreaddons/-/blob/3618917edde2d200a6b34f099be151d21e1103f9/src/lib/io/kfileutils.cpp#L27-29
https://invent.kde.org/frameworks/kcoreaddons/-/blob/3618917edde2d200a6b34f099be151d21e1103f9/autotests/kfileutilstest.cpp#L37-38
--
You are receiving this mail because:
You are watching all bug changes.