Diffusion KIO f0ae038490e6

Move handling of untrusted programs to ApplicationLauncherJob.

Authored by dfaure on Apr 25 2020, 1:35 PM.

Description

Move handling of untrusted programs to ApplicationLauncherJob.

Summary:
This was still in KRun so the porting to ApplicationLauncherJob
was actually losing that feature along the way.

Move KRun's handling of untrusted programs to a separate class
and provide it via an interface used by ApplicationLauncherJob
and implemented in KIOWidgets.

Ideally KIOWidget's JobUiDelegate class would implement it,
but that's an exported class so it would be BIC.
So for KF5, the JobUiDelegate registers the handler into kiogui
using an internal global setter, and in KF6 JobUiDelegate itself
can implement that interface. The benefit of this approach is
that the application code stays the same:

job->setUiDelegate(new KIO::JobUiDelegate);

We'll have to update all the "new KDialogUiDelegate" to the above
line instead, where using ApplicationLauncherJob.

Test Plan:
Unittest + starting a non-executable desktop file
and a non-executable copy of dolphin, in dolphin.

Reviewers: ahmadsamir, broulik, ngraham, mdlubakowski

Reviewed By: broulik

Subscribers: kde-frameworks-devel

Tags: Frameworks

Maniphest Tasks: T11549

Differential Revision: https://phabricator.kde.org/D29153

Details