Summary: | Can't open files beginning with colon (:) | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kio | Reporter: | kdebugs |
Component: | Open/save dialogs | Assignee: | David Faure <faure> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | a.samirh78, adaptee, aria, bugseforuns, jonan88, kdelibs-bugs, nate, usnay12345 |
Priority: | NOR | Keywords: | usability |
Version: | 5.45.0 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/frameworks/kio/commit/c5dbb7c5452f1af637540efdf09061765c0ffb2d | Version Fixed In: | 5.78 |
Sentry Crash Report: |
Description
kdebugs
2013-07-26 06:53:06 UTC
I can confirm this bug in 4.10.5. I also tried it in git master but the behavior is different: I created 3 files with the following names: '-test', ':test' and 'files "test"'. - Starting a file name with a tile seams to work properly on master - Starting a file name with a colon and trying to open it not only failed, but it created a dir named ":" and a file named ":test.desktop" in my home directory - Trying to open the file 'file "test"' created a new file named only 'test' and opened that new file. ~ (tilde) is bug 317513 " (quotes) is bug 185433 Regarding the : (colon), this could be related to Qt resources or Windows path handling. Using this bug to track just the colon issue, since we have other bugs for the other characters. *** Bug 267371 has been marked as a duplicate of this bug. *** *** Bug 312226 has been marked as a duplicate of this bug. *** A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/250 That MR only covers the kfilewidget case; for kate I'll open a separate report to track the issue. I've opened bug 430216. Git commit c5dbb7c5452f1af637540efdf09061765c0ffb2d by Ahmad Samir. Committed on 12/12/2020 at 10:15. Pushed by dfaure into branch 'master'. KFileWidget: allow files that begin with a ':' to be selected The issue was that a ':' at the beginning denotes a Qt Resource and in that case QDir::isAbsolutePath() would return true. The bug is fixed by guarding against that condition in slotOk(). Also guard other QDir::isAbsolutePath() usage the same way. Since this logic will be used in various places use a helper function, isAbsoluteLocalPath() (thanks to dfaure for coming up with that name), in pathhelpers_p.h. Extend the unit tests. FIXED-IN: 5.78 M +15 -6 autotests/kfilewidgettest.cpp M +5 -6 src/filewidgets/kfilewidget.cpp M +10 -0 src/pathhelpers_p.h https://invent.kde.org/frameworks/kio/commit/c5dbb7c5452f1af637540efdf09061765c0ffb2d |