Bug 353799

Summary: KRun chokes on KFileItem::targetUrl() for filenames containing #
Product: [Unmaintained] kio Reporter: Leonardo da Silva <leonardodasilva1915>
Component: generalAssignee: David Faure <faure>
Status: RESOLVED FIXED    
Severity: normal CC: faure, hein, kde, nate, plasma-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
URL: http://i.imgur.com/PAeDor9.png
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Leonardo da Silva 2015-10-11 17:43:17 UTC
won't open file names containing hash #
if filename  in desktop is: [#GNU]archive.txt
double click in "desktop icon", display this dialog message: http://i.imgur.com/PAeDor9.png
dolphin: "this bug not work "

Reproducible: Always

Steps to Reproduce:
1. enable desktop icons in plasma shell
2. create a file in desktop with name [#GNU]archive.txt
3. try open.
Comment 1 Eike Hein 2015-10-13 18:31:15 UTC
David, can you please comment on how to handle this best? Handing KFileItem::localPath to QUrl::fromLocalFile isn't an acceptable workaround because KFileItem::isLocalFile may not be true, either (e.g. it currently fails for desktop:/).
Comment 2 David Faure 2015-10-17 12:54:40 UTC
Eike, does this mean you have located the faulty code? A basic test of the KRun ctor with a local file with # in the path works (I added a '#' to the filename in KRunUnitTest::testMimeTypeFile).

(I don't use Plasma5 yet, resizing a window makes Xorg crash too often)
Comment 3 Eike Hein 2015-10-18 16:18:06 UTC
^ No, I've only printed the QUrl being handed to KRun: QUrl("file:///home/sho/Desktop/[#GNU]archive.txt")

Subsequently I tried QUrl::fromLocalFile on KFileItem::localPath to construct the URL, but with identical results + KFileItem::isLocalFile isn't always reliable.
Comment 4 Nate Graham 2018-04-24 21:23:20 UTC
Opening a file on the desktop called "[#GNU]archive.txt" works fine for me in KDE Frameworks 5.45 and Plasma 5.12.4.

If anyone can reproduce with recent versions of the software, please re-open.