┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/global.cpp
diff options
context:
space:
mode:
authorDavid Faure <[email protected]>2020-04-13 22:49:10 +0200
committerDavid Faure <[email protected]>2020-04-15 00:44:58 +0200
commit30257697e2ea0fa4b3682cbca38936752d914dd4 (patch)
treed2f9f6782522650e9a90c9a02c9c1064b3fe805d /src/global.cpp
parenta2052105089309b87b3b94eba820c76d02d5a187 (diff)
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
Diffstat (limited to 'src/global.cpp')
-rw-r--r--src/global.cpp16
1 files changed, 8 insertions, 8 deletions
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 <KRun>
+#include <KDialogJobUiDelegate>
+#include <KIO/ApplicationLauncherJob>
+#include <KService>
#include <KWindowSystem>
#include <QApplication>
@@ -60,13 +62,11 @@ void Dolphin::openNewWindow(const QList<QUrl> &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<QUrl>& inputUrls, bool openFiles, bool splitView, const QString& preferredService)