Bug 425396

Summary: New folder named ":foo" always created in home dir
Product: [Frameworks and Libraries] frameworks-kio Reporter: nahoj
Component: generalAssignee: KIO Bugs <kio-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: bugseforuns, kdelibs-bugs, kfm-devel, nate
Priority: NOR    
Version: git master   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 5.75

Description nahoj 2020-08-15 19:11:24 UTC
When I try to create a new folder in any folder, if I give it a name starting with ':' (a colon), the folder is created under my home dir (/home/mylogin) instead of the current dir.

Observed in Dolphin 19.04.3 (up-to-date Kubuntu 19.10) and 19.12.3 (Kubuntu 20.04). Same behavior in Konqueror.

STEPS TO REPRODUCE
1. In Dolphin, open /tmp or any folder other than /home/mylogin
2. In the main area, right click > Create new > Folder
3. Type in ":Abc", Enter

OBSERVED RESULT

There is no :Abc folder in the current folder but there is an :Abc folder in /home/mylogin

EXPECTED RESULT

There is a :Abc folder in the current folder and no :Abc folder in /home/mylogin

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.4.0-42-generic (Kubuntu 20.04)
(available in About System)
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8
Comment 1 Patrick Silva 2020-08-16 14:12:46 UTC
I can confirm this behavior.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.19.80
KDE Frameworks Version: 5.74.0
Qt Version: 5.14.2
Comment 2 Bug Janitor Service 2020-09-16 14:56:01 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/138
Comment 3 Ahmad Samir 2020-09-18 18:52:42 UTC
Git commit 9d0a8240c7ec258b45b156f0970af56ab4fc4584 by Ahmad Samir.
Committed on 18/09/2020 at 18:52.
Pushed by ahmadsamir into branch 'master'.

KNewFileMenu: fix creating new dir with name starting with ':'

QDir::isAbsolutePath(":foo") will return true since ':' at the beginning
denotes a QResource, which will make by QDir/QFileInfo consider it "not
relative, so it's absolute"...
FIXED-IN: 5.75

M  +3    -1    src/filewidgets/knewfilemenu.cpp

https://invent.kde.org/frameworks/kio/commit/9d0a8240c7ec258b45b156f0970af56ab4fc4584