<table><tr><td style="">dfaure created this revision.<br />dfaure added reviewers: ahmadsamir, broulik, ngraham.<br />Herald added a project: Frameworks.<br />Herald added a subscriber: kde-frameworks-devel.<br />dfaure requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D29153">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>This was still in KRun so the porting to ApplicationLauncherJob<br />
was actually losing that feature along the way.</p>

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

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

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">job->setUiDelegate(new KIO::JobUiDelegate);</pre></div>

<p>We'll have to update all the "new KDialogUiDelegate" to the above<br />
line instead, where using ApplicationLauncherJob.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Unittest + starting a non-executable desktop file<br />
and a non-executable copy of dolphin, in dolphin.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R241 KIO</div></div></div><br /><div><strong>BRANCH</strong><div><div>2020_04_UntrustedProgramHandler</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D29153">https://phabricator.kde.org/D29153</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>autotests/applicationlauncherjobtest.cpp<br />
autotests/applicationlauncherjobtest.h<br />
src/core/CMakeLists.txt<br />
src/core/jobuidelegateextension.h<br />
src/core/untrustedprogramhandlerinterface.cpp<br />
src/core/untrustedprogramhandlerinterface.h<br />
src/gui/applicationlauncherjob.cpp<br />
src/gui/applicationlauncherjob.h<br />
src/widgets/CMakeLists.txt<br />
src/widgets/jobuidelegate.cpp<br />
src/widgets/krun.cpp<br />
src/widgets/widgetsuntrustedprogramhandler.cpp<br />
src/widgets/widgetsuntrustedprogramhandler.h</div></div></div><br /><div><strong>To: </strong>dfaure, ahmadsamir, broulik, ngraham<br /><strong>Cc: </strong>kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns<br /></div>