Bug 476089 - [ servicemenus ] python script inside .desktop issue
Summary: [ servicemenus ] python script inside .desktop issue
Status: RESOLVED NOT A BUG
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-25 16:36 UTC by chibo
Modified: 2023-10-26 15:31 UTC (History)
1 user (show)

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


Attachments

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