diff options
| author | Ahmad Samir <[email protected]> | 2020-08-18 08:43:58 +0000 |
|---|---|---|
| committer | David Faure <[email protected]> | 2020-08-18 08:43:58 +0000 |
| commit | 257eeebf4b71f846799009394370e0755a4225e1 (patch) | |
| tree | 9cc6ede544903eccb96fd927a4af205f179649a3 /src/dolphinviewcontainer.cpp | |
| parent | 864b59fcf1915bd2ca13703cc1e625f435224b27 (diff) | |
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.
Diffstat (limited to 'src/dolphinviewcontainer.cpp')
| -rw-r--r-- | src/dolphinviewcontainer.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
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 <KFileItemActions> #include <KFilePlacesModel> #include <KIO/PreviewJob> +#include <KIO/OpenUrlJob> +#include <KIO/JobUiDelegate> #include <KLocalizedString> #include <KMessageWidget> #include <KProtocolManager> -#include <KRun> #include <KShell> #include <KUrlComboBox> #include <KUrlNavigator> @@ -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) |
