From 257eeebf4b71f846799009394370e0755a4225e1 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Tue, 18 Aug 2020 08:43:58 +0000 Subject: Port KRun to OpenUrlJob In DolphinMainWindow, since KRun allows running executables by default, use setRunExecutables(true) so as not to change the behaviour. Remove the now redundant slotHandleUrlStatFinished, that whole StatJob logic is now handled by OpenUrlJob. Bump KF required version to 5.73, since that's where OpenUrlJob::setShowOpenOrExecuteDialog was introduced. --- src/dolphinviewcontainer.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/dolphinviewcontainer.cpp') diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 4ab34a06a..7809ca7e3 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -38,10 +38,11 @@ #include #include #include +#include +#include #include #include #include -#include #include #include #include @@ -645,8 +646,10 @@ void DolphinViewContainer::slotItemActivated(const KFileItem& item) return; } - KRun *run = new KRun(item.targetUrl(), this); - run->setShowScriptExecutionPrompt(true); + KIO::OpenUrlJob *job = new KIO::OpenUrlJob(item.targetUrl()); + job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this)); + job->setShowOpenOrExecuteDialog(true); + job->start(); } void DolphinViewContainer::slotItemsActivated(const KFileItemList& items) -- cgit v1.3