Commit d208c478 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

[containmentactions/applauncher] Use ApplicationLauncherJob instead of

OpenUrlJob

We are starting a KService, but with extra steps. Use the appropriate
job.

This fixes launching apps since OpenUrlJob, by default, doesn't launch
executables

BUG: 449900
(cherry picked from commit 15021b43)
parent 9302030f
Pipeline #136174 passed with stage
in 12 minutes and 24 seconds
......@@ -8,7 +8,7 @@
#include <QDebug>
#include <KIO/OpenUrlJob>
#include <KIO/ApplicationLauncherJob>
#include <Plasma/PluginLoader>
AppLauncher::AppLauncher(QObject *parent, const QVariantList &args)
......@@ -49,7 +49,7 @@ void AppLauncher::makeMenu(QMenu *menu, const KServiceGroup::Ptr group)
QAction *action = new QAction(QIcon::fromTheme(service->icon()), text, this);
connect(action, &QAction::triggered, [action]() {
KService::Ptr service = KService::serviceByStorageId(action->data().toString());
auto job = new KIO::OpenUrlJob(QUrl("file://" + service->entryPath()));
auto job = new KIO::ApplicationLauncherJob(service);
job->start();
});
action->setData(service->storageId());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment