From: David Faure Date: Mon, 13 Apr 2020 20:49:10 +0000 (+0200) Subject: Port KRun::run usage to run another Dolphin process, to ApplicationLauncherJob X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/30257697e2ea0fa4b3682cbca38936752d914dd4?ds=sidebyside Port KRun::run usage to run another Dolphin process, to ApplicationLauncherJob Test Plan: Opening a new window works Reviewers: elvisangelaccio, ngraham, meven Reviewed By: elvisangelaccio, meven Subscribers: meven, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D28807 --- diff --git a/src/global.cpp b/src/global.cpp index 5236fa4d1..19f43e06b 100644 --- a/src/global.cpp +++ b/src/global.cpp @@ -23,7 +23,9 @@ #include "dolphindebug.h" #include "dolphinmainwindowinterface.h" -#include +#include +#include +#include #include #include @@ -60,13 +62,11 @@ void Dolphin::openNewWindow(const QList &urls, QWidget *window, const Open if (!urls.isEmpty()) { command.append(QLatin1String(" %U")); } - KRun::run( - command, - urls, - window, - QApplication::applicationDisplayName(), - QApplication::windowIcon().name() - ); + KService::Ptr service(new KService(QApplication::applicationDisplayName(), command, QApplication::windowIcon().name())); + auto *job = new KIO::ApplicationLauncherJob(service, window); + job->setUrls(urls); + job->setUiDelegate(new KDialogJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, window)); + job->start(); } bool Dolphin::attachToExistingInstance(const QList& inputUrls, bool openFiles, bool splitView, const QString& preferredService)