From cde7f8a9862cff286ad9ed61d8d670b5e925b82d Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Sun, 28 Mar 2021 22:24:20 +0200 Subject: [PATCH] Deprecate PluginLoader::listEngineInfoByCategory It isn't used anywhere. It is problematic since it returns KPluginInfo. Instead one can use the KPluginMetaData-based method and do the filtering manually --- src/plasma/CMakeLists.txt | 2 +- src/plasma/pluginloader.cpp | 2 ++ src/plasma/pluginloader.h | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plasma/CMakeLists.txt b/src/plasma/CMakeLists.txt index ef594f58a..1f9ed4a3d 100644 --- a/src/plasma/CMakeLists.txt +++ b/src/plasma/CMakeLists.txt @@ -83,7 +83,7 @@ ecm_generate_export_header(KF5Plasma GROUP_BASE_NAME KF VERSION ${KF_VERSION} DEPRECATED_BASE_VERSION 0 - DEPRECATION_VERSIONS 5.6 5.19 5.28 5.30 5.36 5.46 5.67 5.77 5.78 + DEPRECATION_VERSIONS 5.6 5.19 5.28 5.30 5.36 5.46 5.67 5.77 5.78 5.81 ) # TODO: add support for EXCLUDE_DEPRECATED_BEFORE_AND_AT to all Plasma libs # needs fixing of undeprecated API being still implemented using own deprecated API diff --git a/src/plasma/pluginloader.cpp b/src/plasma/pluginloader.cpp index 577e0c2dc..8ed73375b 100644 --- a/src/plasma/pluginloader.cpp +++ b/src/plasma/pluginloader.cpp @@ -277,6 +277,7 @@ KPluginInfo::List PluginLoader::listEngineInfo(const QString &parentApp) } #endif +#if PLASMA_BUILD_DEPRECATED_SINCE(5, 81) KPluginInfo::List PluginLoader::listEngineInfoByCategory(const QString &category, const QString &parentApp) { KPluginInfo::List list; @@ -304,6 +305,7 @@ KPluginInfo::List PluginLoader::listEngineInfoByCategory(const QString &category return list; } +#endif Service *PluginLoader::loadService(const QString &name, const QVariantList &args, QObject *parent) { diff --git a/src/plasma/pluginloader.h b/src/plasma/pluginloader.h index 809528a92..4050f8874 100644 --- a/src/plasma/pluginloader.h +++ b/src/plasma/pluginloader.h @@ -86,6 +86,7 @@ public: static KPluginInfo::List listEngineInfo(const QString &parentApp = QString()); #endif +#if PLASMA_ENABLE_DEPRECATED_SINCE(5, 81) /** * Returns a list of all known dataengines filtering by category. * @@ -99,9 +100,12 @@ public: * The default value of QString() will result in a * list of all dataengines in specified categories. * @return list of dataengines + * @deprecated since 5.81, use listDataEngineMetaData() instead. * @since 4.3 **/ + PLASMA_DEPRECATED_VERSION(5, 81, "Use listDataEngineMetaData instead") static KPluginInfo::List listEngineInfoByCategory(const QString &category, const QString &parentApp = QString()); +#endif /** * Load a Service plugin.