[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
wilder-5.25
Nicolas Fella 4 years ago
parent c76f1443c0
commit 15021b432a
  1. 4
      containmentactions/applauncher/launch.cpp

@ -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());

Loading…
Cancel
Save