diff --git a/applets/icon/iconapplet.cpp b/applets/icon/iconapplet.cpp --- a/applets/icon/iconapplet.cpp +++ b/applets/icon/iconapplet.cpp @@ -40,12 +40,14 @@ #include #include #include -#include #include #include #include #include +#include +#include +#include #include #include #include @@ -335,23 +337,24 @@ KDesktopFile desktopFile(m_localPath); if (m_jumpListActions.isEmpty()) { - const QStringList actions = desktopFile.readActions(); - for (const QString &actionName : actions) { - const KConfigGroup &actionGroup = desktopFile.actionGroup(actionName); + const KService service(m_localPath); - if (!actionGroup.isValid() || !actionGroup.exists()) { + const auto jumpListActions = service.actions(); + for (const KServiceAction &serviceAction : jumpListActions) { + if (serviceAction.noDisplay()) { continue; } - const QString name = actionGroup.readEntry(QStringLiteral("Name")); - const QString exec = actionGroup.readEntry(QStringLiteral("Exec")); - if (name.isEmpty() || exec.isEmpty()) { - continue; + QAction *action = new QAction(QIcon::fromTheme(serviceAction.icon()), serviceAction.text(), this); + if (serviceAction.isSeparator()) { + action->setSeparator(true); } - QAction *action = new QAction(QIcon::fromTheme(actionGroup.readEntry("Icon")), name, this); - connect(action, &QAction::triggered, this, [this, exec] { - KRun::run(exec, {}, nullptr, m_name, m_iconName); + connect(action, &QAction::triggered, this, [this, serviceAction]() { + auto *job = new KIO::ApplicationLauncherJob(serviceAction); + auto *delegate = new KNotificationJobUiDelegate(KJobUiDelegate::AutoErrorHandlingEnabled); + job->setUiDelegate(delegate); + job->start(); }); m_jumpListActions << action;