Changeset View
Changeset View
Standalone View
Standalone View
applets/kicker/plugin/actionlist.cpp
Show All 22 Lines | |||||
23 | 23 | | |||
24 | #include <config-appstream.h> | 24 | #include <config-appstream.h> | ||
25 | 25 | | |||
26 | #include <QApplication> | 26 | #include <QApplication> | ||
27 | #include <QDesktopServices> | 27 | #include <QDesktopServices> | ||
28 | #include <QDir> | 28 | #include <QDir> | ||
29 | #include <QStandardPaths> | 29 | #include <QStandardPaths> | ||
30 | 30 | | |||
31 | #include <KIO/ApplicationLauncherJob> | ||||
31 | #include <KLocalizedString> | 32 | #include <KLocalizedString> | ||
32 | #include <KMimeTypeTrader> | 33 | #include <KMimeTypeTrader> | ||
34 | #include <KNotificationJobUiDelegate> | ||||
33 | #include <KPropertiesDialog> | 35 | #include <KPropertiesDialog> | ||
34 | #include <KProtocolInfo> | 36 | #include <KProtocolInfo> | ||
35 | #include <KRun> | | |||
36 | 37 | | |||
37 | #include <KActivities/Stats/Cleaning> | 38 | #include <KActivities/Stats/Cleaning> | ||
38 | #include <KActivities/Stats/ResultSet> | 39 | #include <KActivities/Stats/ResultSet> | ||
39 | #include <KActivities/Stats/Terms> | 40 | #include <KActivities/Stats/Terms> | ||
40 | 41 | | |||
41 | #include "containmentinterface.h" | 42 | #include "containmentinterface.h" | ||
42 | 43 | | |||
43 | #ifdef HAVE_APPSTREAMQT | 44 | #ifdef HAVE_APPSTREAMQT | ||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | 116 | { | |||
126 | if (actionId == QLatin1String("_kicker_fileItem_openWith")) { | 127 | if (actionId == QLatin1String("_kicker_fileItem_openWith")) { | ||
127 | const QString path = argument.toString(); | 128 | const QString path = argument.toString(); | ||
128 | const KService::Ptr service = KService::serviceByDesktopPath(path); | 129 | const KService::Ptr service = KService::serviceByDesktopPath(path); | ||
129 | 130 | | |||
130 | if (!service) { | 131 | if (!service) { | ||
131 | return false; | 132 | return false; | ||
132 | } | 133 | } | ||
133 | 134 | | |||
134 | KRun::runService(*service, QList<QUrl>() << fileItem.url(), QApplication::activeWindow()); | 135 | auto *job = new KIO::ApplicationLauncherJob(service); | ||
136 | job->setUrls({fileItem.url()}); | ||||
137 | job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled)); | ||||
138 | job->start(); | ||||
135 | 139 | | |||
136 | *close = true; | 140 | *close = true; | ||
137 | 141 | | |||
138 | return true; | 142 | return true; | ||
139 | } | 143 | } | ||
140 | 144 | | |||
141 | return false; | 145 | return false; | ||
142 | } | 146 | } | ||
▲ Show 20 Lines • Show All 166 Lines • ▼ Show 20 Line(s) | 292 | { | |||
309 | } | 313 | } | ||
310 | 314 | | |||
311 | QString argument = _argument.toString(); | 315 | QString argument = _argument.toString(); | ||
312 | 316 | | |||
313 | if (argument.isEmpty()) { | 317 | if (argument.isEmpty()) { | ||
314 | return false; | 318 | return false; | ||
315 | } | 319 | } | ||
316 | 320 | | |||
317 | return (KRun::runService(*service, QList<QUrl>() << QUrl(argument), QApplication::activeWindow()) != 0); | 321 | auto *job = new KIO::ApplicationLauncherJob(service); | ||
322 | job->setUrls({QUrl(argument)}); | ||||
323 | job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled)); | ||||
324 | return job->exec(); | ||||
318 | } | 325 | } | ||
319 | 326 | | |||
320 | Q_GLOBAL_STATIC(MenuEntryEditor, menuEntryEditor) | 327 | Q_GLOBAL_STATIC(MenuEntryEditor, menuEntryEditor) | ||
321 | 328 | | |||
322 | bool canEditApplication(const KService::Ptr &service) | 329 | bool canEditApplication(const KService::Ptr &service) | ||
323 | { | 330 | { | ||
324 | return (service->isApplication() && menuEntryEditor->canEdit(service->entryPath())); | 331 | return (service->isApplication() && menuEntryEditor->canEdit(service->entryPath())); | ||
325 | } | 332 | } | ||
▲ Show 20 Lines • Show All 90 Lines • Show Last 20 Lines |