From 40035fe5bf4d146ba1d480493ddb1da2779180af Mon Sep 17 00:00:00 2001 From: David Faure Date: Sun, 5 Apr 2020 13:44:12 +0200 Subject: [PATCH] Dolphin: port to CommandLauncherJob Summary: git master already requires 5.69 anyway, due to KBookmarkMenu API change Test Plan: Builds, Tools / Compare Files works. Reviewers: broulik, elvisangelaccio, meven Reviewed By: elvisangelaccio, meven Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D28589 --- src/dolphinmainwindow.cpp | 6 +++++- src/dolphintabwidget.cpp | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index f88bc3f44f..9fe870044f 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -926,7 +927,10 @@ void DolphinMainWindow::compareFiles() command.append("\" \""); command.append(urlB.toDisplayString(QUrl::PreferLocalFile)); command.append('\"'); - KRun::runCommand(command, QStringLiteral("Kompare"), QStringLiteral("kompare"), this); + + KIO::CommandLauncherJob *job = new KIO::CommandLauncherJob(command, this); + job->setDesktopName(QStringLiteral("org.kde.kompare")); + job->start(); } void DolphinMainWindow::toggleShowMenuBar() diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp index 89c54baf54..fba6fe0849 100644 --- a/src/dolphintabwidget.cpp +++ b/src/dolphintabwidget.cpp @@ -25,9 +25,9 @@ #include "dolphinviewcontainer.h" #include -#include #include #include +#include #include #include @@ -334,8 +334,9 @@ void DolphinTabWidget::detachTab(int index) } args << QStringLiteral("--new-window"); - const QString command = QStringLiteral("dolphin %1").arg(KShell::joinArgs(args)); - KRun::runCommand(command, this); + KIO::CommandLauncherJob *job = new KIO::CommandLauncherJob("dolphin", args, this); + job->setDesktopName(QStringLiteral("org.kde.dolphin")); + job->start(); closeTab(index); }