Bug 467369 - When creating a link to an application from the desktop context menu, selecting the program path from the browse dialogue doesn't work with spaces
Summary: When creating a link to an application from the desktop context menu, selecti...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Properties dialog (show other bugs)
Version: 5.104.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
: 470038 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-03-14 22:15 UTC by squaduck
Modified: 2023-05-22 19:53 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.106
Sentry Crash Report:


Attachments
Short video of the bug (1.57 MB, video/x-matroska)
2023-03-14 22:15 UTC, squaduck
Details
actual webm video (1.14 MB, video/webm)
2023-03-14 22:26 UTC, squaduck
Details

Note You need to log in before you can comment on or make changes to this bug.
Description squaduck 2023-03-14 22:15:54 UTC
Created attachment 157288 [details]
Short video of the bug

SUMMARY
When creating a link to an application from the desktop context menu, selecting the program path from the browse dialogue will produce a mess of escaped quotes in the .desktop file

STEPS TO REPRODUCE
1. Right click on the desktop and navigate to Create New -> Link to Application 
2. Click over to the "Application" tab
3. Click the "Browse..." button to open the browse dialogue
4. Navigate to an application with a space character in the path and open it
5. The "Program:" field will now be populated with something like '/path/to/the application/application'
6. Click OK

OBSERVED RESULT
The created .desktop file will now have a line like Exec=''\\''/path/to/the application/application'\\'''

EXPECTED RESULT
The line being Exec='/path/to/the application/application'

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: OpenSUSE Tumbleweed 20230313
KDE Plasma Version: 5.27.2
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8
Comment 1 squaduck 2023-03-14 22:26:33 UTC
Created attachment 157289 [details]
actual webm video
Comment 2 Nate Graham 2023-03-15 17:38:49 UTC
Can reproduce the issue.
Comment 3 Bug Janitor Service 2023-04-24 04:09:05 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1264
Comment 4 Bharadwaj Raju 2023-04-25 18:11:14 UTC
Git commit 37481256967b1f0f24e6da8530eacb8bbec758bf by Bharadwaj Raju.
Committed on 25/04/2023 at 18:11.
Pushed by bharadwaj-raju into branch 'master'.

KPropertiesDialog: Don't quote the path unnecessarily

We don't need to KShell::quoteArg the executable path, since we use
KShell::joinArgs later which takes care of proper quoting.

cc @davidedmundson 

M  +1    -2    src/widgets/kpropertiesdialog.cpp

https://invent.kde.org/frameworks/kio/commit/37481256967b1f0f24e6da8530eacb8bbec758bf
Comment 5 Bharadwaj Raju 2023-04-25 18:12:24 UTC
Git commit bf3c43369b5626740339a62733715ec27104db7e by Bharadwaj Raju.
Committed on 25/04/2023 at 18:12.
Pushed by bharadwaj-raju into branch 'kf5'.

KPropertiesDialog: Don't quote the path unnecessarily

We don't need to KShell::quoteArg the executable path, since we use
KShell::joinArgs later which takes care of proper quoting.

cc @davidedmundson 


(cherry picked from commit 37481256967b1f0f24e6da8530eacb8bbec758bf)

M  +1    -2    src/widgets/kpropertiesdialog.cpp

https://invent.kde.org/frameworks/kio/commit/bf3c43369b5626740339a62733715ec27104db7e
Comment 6 Nate Graham 2023-05-22 19:53:30 UTC
*** Bug 470038 has been marked as a duplicate of this bug. ***