Skip to content

kcms/keys: Make Add Command work with percent characters in commands

Right now KIO DesktopExecParser returns nothing if it gets a command with a percent in it other than valid desktop-file placeholders like %F etc. Escaping doesn't seem to help.

So, we don't just return if it can't find an executableName.

Also, we escape the percents by replacing them with %% so that the command works when it does end up getting into a .desktop file.

Suggested command for testing: qdbus org.kde.klipper /klipper setClipboardContents $(date +"%Y-%m-%d"). Thanks to https://old.reddit.com/r/kde/comments/12if4ed/custom_shortcuts_using_qdbus_still_supported/ for highlighting this issue.

cc @ngraham

This should be cherry-picked to 5.27 probably, as it's a bugfix.

Merge request reports

Loading