diff --git a/src/plasma/pluginloader.cpp b/src/plasma/pluginloader.cpp --- a/src/plasma/pluginloader.cpp +++ b/src/plasma/pluginloader.cpp @@ -502,9 +502,10 @@ KPluginInfo::List PluginLoader::listAppletInfo(const QString &category, const QString &parentApp) { - KPluginInfo::List list; const auto plugins = listAppletMetaData(category, parentApp); +#if KSERVICE_BUILD_DEPRECATED_SINCE(5, 0) + KPluginInfo::List list; //NOTE: it still produces kplugininfos from KServices because some user code expects //info.service() to be valid and would crash otherwise for (const auto &md : plugins) { @@ -516,6 +517,9 @@ list << pi; } return list; +#else + return KPluginInfo::fromMetaData(plugins.toVector()); +#endif } QList PluginLoader::listAppletMetaDataForMimeType(const QString &mimeType) @@ -673,7 +677,7 @@ QSet types; for (const KPluginInfo &containmentInfo : containmentInfos) { - const QStringList theseTypes = containmentInfo.service()->property(QStringLiteral("X-Plasma-ContainmentType")).toStringList(); + const QStringList theseTypes = containmentInfo.property(QStringLiteral("X-Plasma-ContainmentType")).toStringList(); for (const QString &type : theseTypes) { types.insert(type); } @@ -719,14 +723,16 @@ knownPlugins.insert(p.pluginName()); } +#if KSERVICE_BUILD_DEPRECATED_SINCE(5, 0) //FIXME: this is only for backwards compatibility, but probably will have to stay //for the time being const KService::List offers = KServiceTypeTrader::self()->query(QStringLiteral("Plasma/ContainmentActions"), constraint); for (KService::Ptr s : offers) { if (!knownPlugins.contains(s->pluginKeyword())) { list.append(KPluginInfo(s)); } } +#endif return list; } diff --git a/src/plasma/private/containmentactions_p.h b/src/plasma/private/containmentactions_p.h --- a/src/plasma/private/containmentactions_p.h +++ b/src/plasma/private/containmentactions_p.h @@ -29,7 +29,11 @@ { public: ContainmentActionsPrivate(const QVariant& arg, ContainmentActions */*containmentActions*/) +#if KSERVICE_BUILD_DEPRECATED_SINCE(5, 0) : containmentActionsDescription(arg.canConvert() ? arg.value() : KPluginInfo(KService::serviceByStorageId(arg.toString())).toMetaData()) +#else + : containmentActionsDescription(arg.value()) +#endif { }