馃崚runners/services: handle malformed .desktop file names better

Original commit message(s)

  • runners/services: handle malformed .desktop file names better

.desktop file names should be valid dbus well-known names, but in the wild you may find some with invalid names, such as including the character ":". Until recently, even kmenuedit would create such files if the user used a : in the human-readable name. This completely breaks the service runner: a malformed file like "Test: 1. desktop" is parsed as the path "1.desktop" on the "test" scheme, has its scheme replaced by "applications", and trying to launch the resulting id "applications: 1.desktop" will fail, as will trying to favorite the match in a launcher.

Instead, create the QUrl and explicitly set the storageId of the service as the path, which protects it from having parts misidentified as a scheme.

CCBUG: 520894

(cherry picked from commit 44153ae0)

Co-authored-by: Christoph Wolk cwo.kde@posteo.net

Reason for the change

Test plan

Screenshots or screen recordings

Bugs fixed

Merge request reports

Loading