Bug 255412

Summary: KEditFileType dialogue fails when adding applications with spaces in path
Product: [Unmaintained] kdelibs Reporter: Lukas <1lukas1>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: faure, peter.penz19, romain.perier, tomashnyk
Priority: NOR    
Version First Reported In: 4.5   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: kdelibs_kurlrequester_escape_whitespaces.patch

Description Lukas 2010-10-27 16:10:41 UTC
Version:           unspecified (using KDE 4.5.2) 
OS:                Linux

In save process it trims to the first space

Reproducible: Always

Steps to Reproduce:
Dolphin > Properties > Edit file type > Add 
Try to add something like ~/bins/XMind portable/xmind-bin"

Actual Results:  
It alerts with Error 
'/home/lukas/bins/XMind' not found, please type valid program name


Expected Results:  
It should use "/home/lukas/bins/XMind portable/xmind-bin" instead of "/home/lukas/bins/XMind"
Comment 1 Romain Perier 2010-10-28 21:48:55 UTC
The problem is caused by whitespaces which are interpreted as seperators in KRun::binaryName() from kopenwithdialog::checkAccept().

A way to fix this issue is to prefix each whitespace with a backslash or to quote them. Typically when the kfiledialog returns accepted urls in kurlrequester (used by openwithdialog to get back the url) we've to just to escape whitespaces.

Note: We can't fix it in kopenwithdialog since strings received from kurlrequester can already contain arguments (with non-escapable whitespaces).

KUrl are stocked as QString in kurlrequester (and send to klineedit), so we've to escape each string converted from a kurl, and unescape these strings to get back the original kurl (setUrl() and url()).

See a patch in attachment, feel free to comment it
Comment 2 Romain Perier 2010-10-28 21:49:55 UTC
Created attachment 52953 [details]
kdelibs_kurlrequester_escape_whitespaces.patch
Comment 3 Andrew Crouthamel 2018-11-05 03:07:54 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Andrew Crouthamel 2018-11-16 05:33:13 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version?

Thank you for helping us make KDE software even better for everyone!
Comment 5 tomashnyk 2022-09-27 14:12:01 UTC
I just tried this and it correctly adds '~/try try/kate' in my case.