From 0fee295e86efa3db59fc99119ffe93500e5c1d01 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Mon, 14 Dec 2020 19:27:25 +0100 Subject: [PATCH] Port from KRun to KIO::OpenUrlJob The former is deprecated --- libtaskmanager/CMakeLists.txt | 1 - libtaskmanager/tasktools.cpp | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libtaskmanager/CMakeLists.txt b/libtaskmanager/CMakeLists.txt index 2fee85dd1..9e511cb42 100644 --- a/libtaskmanager/CMakeLists.txt +++ b/libtaskmanager/CMakeLists.txt @@ -49,7 +49,6 @@ target_link_libraries(taskmanager KF5::I18n KF5::KIOCore KF5::KIOGui - KF5::KIOWidgets KF5::Notifications KF5::WaylandClient KF5::WindowSystem diff --git a/libtaskmanager/tasktools.cpp b/libtaskmanager/tasktools.cpp index dfe04b1f5..a82b152e7 100644 --- a/libtaskmanager/tasktools.cpp +++ b/libtaskmanager/tasktools.cpp @@ -28,13 +28,13 @@ License along with this library. If not, see . #include #include #include -#include #include #include #include #include #include +#include #include @@ -824,7 +824,10 @@ void runApp(const AppData &appData, const QList &urls) KActivities::ResourceInstance::notifyAccessed(QUrl(QStringLiteral("applications:") + service->storageId()), QStringLiteral("org.kde.libtaskmanager")); } else { - new KRun(appData.url, nullptr, false, KStartupInfo::createNewStartupIdForTimestamp(timeStamp)); + auto *job = new KIO::OpenUrlJob(appData.url); + job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoErrorHandlingEnabled)); + job->setStartupId(KStartupInfo::createNewStartupIdForTimestamp(timeStamp)); + job->start(); if (!appData.id.isEmpty()) { KActivities::ResourceInstance::notifyAccessed(QUrl(QStringLiteral("applications:") + appData.id),