Bug 460804

Summary: Modifying Execution Command of a Desktop File Causes Error Unable to Find Application
Product: [Applications] kmenuedit Reporter: Sam Duan <samduanx>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED INTENTIONAL    
Severity: normal CC: qydwhotmail
Priority: NOR    
Version First Reported In: 5.26.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: The error given out. (In simplified Chinese)
The modified desktop file. Notice the quotes in the Exec line.
This is what is shown in kmenuedit if I delete the quotes in the desktop file.

Description Sam Duan 2022-10-21 13:40:26 UTC
Created attachment 153085 [details]
The error given out. (In simplified Chinese)

SUMMARY
After modifying an application's execution command, the application refuses to start from Plasma, giving out error "Unable to find application %f" (or something like that, depends on what's filled in the Command-line arguments). Checking the actual desktop file can we see a pair of single quotation marks are added excluding the argument. Deleting the marks makes the application executable from Plasma.


STEPS TO REPRODUCE
1. Start kmenuedit, 
2. Pick a program and modify its execution command (the option "Program"),
3. Save,
4. Run the application from Plasma.

OBSERVED RESULT
The app refuses to start, giving out error "Unable to find application %f".

EXPECTED RESULT
The app would start normally.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE Tumbleweed 20221019
KDE Plasma Version: 5.26.0
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6

ADDITIONAL INFORMATION
Pictures of the error given in simplified Chinese and the modified desktop file are attached.
Comment 1 Sam Duan 2022-10-21 13:41:37 UTC
Created attachment 153086 [details]
The modified desktop file. Notice the quotes in the Exec line.
Comment 2 Fushan Wen 2022-10-21 14:09:40 UTC
You should probably use 

Program: env

Command-Line Arguments: __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia kicad %f
Comment 3 Sam Duan 2022-10-21 14:12:01 UTC
(In reply to Fushan Wen from comment #2)
> You should probably use 
> 
> Program: env
> 
> Command-Line Arguments: __NV_PRIME_RENDER_OFFLOAD=1
> __GLX_VENDOR_LIBRARY_NAME=nvidia kicad %f

Tested just now. Still not working.
Comment 4 Sam Duan 2022-10-21 14:14:14 UTC
Created attachment 153087 [details]
This is what is shown in kmenuedit if I delete the quotes in the desktop file.
Comment 5 Fushan Wen 2022-10-21 14:38:26 UTC
Works here, need more people to confirm it.

https://fars.ee/jgFR.png