Bug 255412 - KEditFileType dialogue fails when adding applications with spaces in path
Summary: KEditFileType dialogue fails when adding applications with spaces in path
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Unmaintained
Component: general (other bugs)
Version First Reported In: 4.5
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-27 16:10 UTC by Lukas
Modified: 2022-09-27 14:12 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
kdelibs_kurlrequester_escape_whitespaces.patch (748 bytes, patch)
2010-10-28 21:49 UTC, Romain Perier
Details

Note You need to log in before you can comment on or make changes to this bug.
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.