diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ PURPOSE "Used by the HTML-based GUI ksysguard library" ) -find_package(KF5 REQUIRED COMPONENTS CoreAddons Config I18n WindowSystem Completion Auth WidgetsAddons IconThemes ConfigWidgets Service GlobalAccel KIO) +find_package(KF5 REQUIRED COMPONENTS CoreAddons Config I18n JobWidgets WindowSystem Completion Auth WidgetsAddons IconThemes ConfigWidgets Service GlobalAccel KIO) find_package(KF5 OPTIONAL_COMPONENTS Plasma) set_package_properties(KF5Plasma PROPERTIES URL "https://cgit.kde.org/plasma-framework.git/" diff --git a/processui/CMakeLists.txt b/processui/CMakeLists.txt --- a/processui/CMakeLists.txt +++ b/processui/CMakeLists.txt @@ -44,9 +44,10 @@ KF5::ConfigWidgets KF5::WidgetsAddons KF5::IconThemes + KF5::JobWidgets KF5::GlobalAccel KF5::Service - KF5::KIOWidgets + KF5::KIOGui ) target_include_directories(processui PUBLIC diff --git a/processui/ksysguardprocesslist.cpp b/processui/ksysguardprocesslist.cpp --- a/processui/ksysguardprocesslist.cpp +++ b/processui/ksysguardprocesslist.cpp @@ -54,11 +54,12 @@ #include #include #include +#include +#include #include #include #include #include -#include #include #include "ReniceDlg.h" @@ -410,8 +411,10 @@ kService->name(), this); connect(action, &QAction::triggered, this, - [kService](bool) { - KRun::runService(*kService, { }, nullptr); + [this, kService](bool) { + auto *job = new KIO::ApplicationLauncherJob(kService); + job->setUiDelegate(new KDialogJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, window())); + job->start(); }); d->mToolsMenu->addAction(action); } @@ -445,8 +448,13 @@ const auto runCommandShortcutList = KGlobalAccel::self()->globalShortcut(QStringLiteral("krunner"), QStringLiteral("run command")); runCommandAction->setShortcuts(runCommandShortcutList); runCommandAction->setIcon(QIcon::fromTheme(QStringLiteral("system-run"))); - connect(runCommandAction, &QAction::triggered, this, [](){ - KRun::runCommand(QStringLiteral("krunner"), nullptr); + connect(runCommandAction, &QAction::triggered, this, [this](){ + KService::Ptr service = KService::serviceByDesktopName(QStringLiteral("krunner")); + if (service) { + auto *job = new KIO::ApplicationLauncherJob(service); + job->setUiDelegate(new KDialogJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, window())); + job->start(); + } }); d->mToolsMenu->addAction(runCommandAction);