KPropertiesDialog: port KRun::run to ApplicationLauncherJob
ClosedPublic

Authored by dfaure on Mar 25 2020, 12:15 AM.

Details

Summary

KRun::run(exec, urls) is somewhere in between the two jobs.
Since we know the name of the desktop file, we might as well use ApplicationLauncherJob here.
Otherwise we would probably need a bit of KShell escaping to turn a QUrl into a command-line arg.

Test Plan

With filelight installed, the button in the properties dialog works.
With the .desktop file still installed but the executable renamed, an error message pops up as expected.

Diff Detail

Repository
R241 KIO
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 24190
Build 24208: arc lint + arc unit
dfaure created this revision.Mar 25 2020, 12:15 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 25 2020, 12:15 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
dfaure requested review of this revision.Mar 25 2020, 12:15 AM
broulik accepted this revision.Mar 29 2020, 10:31 AM

Also +1 for porting to kservice rather than launching binary

src/gui/applicationlauncherjob.h
50

Please add this in a separate commit

src/widgets/kpropertiesdialog.cpp
1458

Call this after setting everything up?

This revision is now accepted and ready to land.Mar 29 2020, 10:31 AM
dfaure added inline comments.Mar 29 2020, 10:38 AM
src/gui/applicationlauncherjob.h
50
src/widgets/kpropertiesdialog.cpp
1458

If you want. Makes no difference, the actual start of a KJob is always delayed.

dfaure closed this revision.Mar 29 2020, 10:38 AM