diff --git a/src/plasma/containmentactions.cpp b/src/plasma/containmentactions.cpp index 23dcbdc86..f5381be31 100644 --- a/src/plasma/containmentactions.cpp +++ b/src/plasma/containmentactions.cpp @@ -37,14 +37,13 @@ namespace Plasma { ContainmentActions::ContainmentActions(QObject *parentObject) - : d(new ContainmentActionsPrivate(KService::serviceByStorageId(QString()), this)) + : d(new ContainmentActionsPrivate({}, this)) { setParent(parentObject); } ContainmentActions::ContainmentActions(QObject *parentObject, const QVariantList &args) - : d(new ContainmentActionsPrivate(KService::serviceByStorageId(args.count() > 0 ? - args[0].toString() : QString()), this)) + : d(new ContainmentActionsPrivate(args.value(0), this)) { setParent(parentObject); @@ -64,7 +63,7 @@ ContainmentActions::~ContainmentActions() KPluginInfo ContainmentActions::pluginInfo() const { - return d->containmentActionsDescription; + return KPluginInfo(d->containmentActionsDescription); } Containment *ContainmentActions::containment() diff --git a/src/plasma/pluginloader.cpp b/src/plasma/pluginloader.cpp index fc9602c18..5dde261c0 100644 --- a/src/plasma/pluginloader.cpp +++ b/src/plasma/pluginloader.cpp @@ -416,10 +416,9 @@ ContainmentActions *PluginLoader::loadContainmentActions(Containment *parent, co if (!plugins.isEmpty()) { KPluginLoader loader(plugins.first().fileName()); - const QVariantList argsWithMetaData = QVariantList() << loader.metaData().toVariantMap(); KPluginFactory *factory = loader.factory(); if (factory) { - actions = factory->create(nullptr, argsWithMetaData); + actions = factory->create(nullptr, {QVariant::fromValue(plugins.first())}); } } if (actions) { diff --git a/src/plasma/private/containmentactions_p.h b/src/plasma/private/containmentactions_p.h index 69227d17b..080349593 100644 --- a/src/plasma/private/containmentactions_p.h +++ b/src/plasma/private/containmentactions_p.h @@ -20,15 +20,17 @@ #ifndef PLASMA_CONTAINMENTACTIONSPRIVATE_H #define PLASMA_CONTAINMENTACTIONSPRIVATE_H +#include + namespace Plasma { class ContainmentActionsPrivate { public: - ContainmentActionsPrivate(KService::Ptr service, ContainmentActions *containmentActions) : + ContainmentActionsPrivate(const QVariant& arg, ContainmentActions *containmentActions) : q(containmentActions), - containmentActionsDescription(service), + containmentActionsDescription(arg.canConvert() ? arg.value() : KPluginInfo(KService::serviceByStorageId(arg.toString())).toMetaData()), package(nullptr), containment(nullptr) { @@ -37,7 +39,7 @@ public: ContainmentActions *q; QString currentTrigger; - KPluginInfo containmentActionsDescription; + const KPluginMetaData containmentActionsDescription; Package *package; KServiceAction mode; Containment *containment;