Bug 476089

Summary: [ servicemenus ] python script inside .desktop issue
Product: [I don't know] kde Reporter: chibo <chombor>
Component: generalAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: RESOLVED NOT A BUG    
Severity: normal CC: fanzhuyifan
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description chibo 2023-10-25 16:36:01 UTC
STEPS TO REPRODUCE
1. copy repo https://github.com/chiboreache/plasma_servicemenus to ~/.local/share/kio/servicemenus/
2. select a few mp4 files (!) with and w/o spaces in filename
3. RMB -> Import to Kdenlive

OBSERVED RESULT
only files without spaces were imported

EXPECTED RESULT
all files were imported

ADDITIONAL INFORMATION
if you uncomment logging function, and copy result straight into your terminal, you will notice that everything just works, but the same string inside .desktop+python_script -- doesn't work

SOFTWARE/OS VERSIONS
everything is bleeding edge
Comment 1 fanzhuyifan 2023-10-26 15:03:10 UTC
Hi! Unfortunately this is not a bug of kde, but a bug of the scripts you provided.

To begin with, in the .desktop file, it might be easier if you don't put quotes around %U. In that way each individual file will be passed in as a separate argument, which makes it easier to deal with.

Furthermore, in the arguments passed to `kdenlive`, the ' ' don't need to be replaced with '\ '.

The desktop file and python script work for me after applying the latter fixes.
Comment 2 chibo 2023-10-26 15:15:39 UTC
(In reply to fanzhuyifan from comment #1)
> Hi! Unfortunately this is not a bug of kde, but a bug of the scripts you
> provided.
> 
> To begin with, in the .desktop file, it might be easier if you don't put
> quotes around %U. In that way each individual file will be passed in as a
> separate argument, which makes it easier to deal with.
> 
> Furthermore, in the arguments passed to `kdenlive`, the ' ' don't need to be
> replaced with '\ '.
> 
> The desktop file and python script work for me after applying the latter
> fixes.

it's not working at all w/o quotes around %U 🤷‍♂️
Comment 3 chibo 2023-10-26 15:23:47 UTC
ok it works only when i select one

but how to parse all instance?
Comment 4 fanzhuyifan 2023-10-26 15:31:34 UTC
Moving discussion to github since this is not a kde issue.

https://github.com/chiboreache/plasma_servicemenus/issues/1