xdgactivation: Make sure we don't call setStartupId with an x11 token

Besides not working on Wayland, it will prevent the job from fetching a
working token.
wilder-5.25
Aleix Pol 4 years ago committed by Aleix Pol Gonzalez
parent ff446e235e
commit aa385fb08f
  1. 5
      applets/kicker/plugin/appentry.cpp
  2. 5
      applets/kicker/plugin/recentusagemodel.cpp
  3. 4
      libtaskmanager/launchertasksmodel.cpp

@ -36,6 +36,7 @@
#include <KShell> #include <KShell>
#include <KStartupInfo> #include <KStartupInfo>
#include <KSycoca> #include <KSycoca>
#include <KWindowSystem>
#include <Plasma/Plasma> #include <Plasma/Plasma>
@ -213,7 +214,9 @@ bool AppEntry::run(const QString &actionId, const QVariant &argument)
auto *job = new KIO::ApplicationLauncherJob(m_service); auto *job = new KIO::ApplicationLauncherJob(m_service);
job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled)); job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled));
job->setRunFlags(KIO::ApplicationLauncherJob::DeleteTemporaryFiles); job->setRunFlags(KIO::ApplicationLauncherJob::DeleteTemporaryFiles);
job->setStartupId(KStartupInfo::createNewStartupIdForTimestamp(timeStamp)); if (KWindowSystem::isPlatformX11()) {
job->setStartupId(KStartupInfo::createNewStartupIdForTimestamp(timeStamp));
}
job->start(); job->start();
KActivities::ResourceInstance::notifyAccessed(QUrl(QStringLiteral("applications:") + m_service->storageId()), QStringLiteral("org.kde.plasma.kicker")); KActivities::ResourceInstance::notifyAccessed(QUrl(QStringLiteral("applications:") + m_service->storageId()), QStringLiteral("org.kde.plasma.kicker"));

@ -41,6 +41,7 @@
#include <KActivities/Stats/Cleaning> #include <KActivities/Stats/Cleaning>
#include <KActivities/Stats/ResultModel> #include <KActivities/Stats/ResultModel>
#include <KActivities/Stats/Terms> #include <KActivities/Stats/Terms>
#include <KWindowSystem>
namespace KAStats = KActivities::Stats; namespace KAStats = KActivities::Stats;
@ -400,7 +401,9 @@ bool RecentUsageModel::trigger(int row, const QString &actionId, const QVariant
auto *job = new KIO::ApplicationLauncherJob(service); auto *job = new KIO::ApplicationLauncherJob(service);
job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled)); job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled));
job->setStartupId(KStartupInfo::createNewStartupIdForTimestamp(timeStamp)); if (KWindowSystem::isPlatformX11()) {
job->setStartupId(KStartupInfo::createNewStartupIdForTimestamp(timeStamp));
}
job->start(); job->start();
KActivities::ResourceInstance::notifyAccessed(QUrl(QStringLiteral("applications:") + storageId), QStringLiteral("org.kde.plasma.kicker")); KActivities::ResourceInstance::notifyAccessed(QUrl(QStringLiteral("applications:") + storageId), QStringLiteral("org.kde.plasma.kicker"));

@ -573,7 +573,9 @@ void LauncherTasksModel::requestOpenUrls(const QModelIndex &index, const QList<Q
auto *job = new KIO::ApplicationLauncherJob(service); auto *job = new KIO::ApplicationLauncherJob(service);
job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoErrorHandlingEnabled)); job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoErrorHandlingEnabled));
job->setUrls(urls); job->setUrls(urls);
job->setStartupId(KStartupInfo::createNewStartupIdForTimestamp(timeStamp)); if (KWindowSystem::isPlatformX11()) {
job->setStartupId(KStartupInfo::createNewStartupIdForTimestamp(timeStamp));
}
job->start(); job->start();
KActivities::ResourceInstance::notifyAccessed(QUrl(QStringLiteral("applications:") + service->storageId()), QStringLiteral("org.kde.libtaskmanager")); KActivities::ResourceInstance::notifyAccessed(QUrl(QStringLiteral("applications:") + service->storageId()), QStringLiteral("org.kde.libtaskmanager"));

Loading…
Cancel
Save