From 75c31c08d560d51fcdeba2dc3d54e5c9d31fb3ca Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Tue, 20 Jul 2021 09:44:50 +0200 Subject: [PATCH] Deprecate plasma/version.h header & contained methods This is obsolete with KPluginLoader::pluginVersion being deprecated. For the other methods the generated plasma_version.h header can be used. Task: https://phabricator.kde.org/T14724 --- src/plasma/CMakeLists.txt | 2 +- src/plasma/version.cpp | 3 +++ src/plasma/version.h | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/plasma/CMakeLists.txt b/src/plasma/CMakeLists.txt index 15d3ec764..6496f331e 100644 --- a/src/plasma/CMakeLists.txt +++ b/src/plasma/CMakeLists.txt @@ -83,7 +83,7 @@ ecm_generate_export_header(KF5Plasma VERSION ${KF_VERSION} DEPRECATED_BASE_VERSION 0 EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT} - DEPRECATION_VERSIONS 5.6 5.19 5.28 5.30 5.36 5.46 5.67 5.77 5.78 5.81 5.83 + DEPRECATION_VERSIONS 5.6 5.19 5.28 5.30 5.36 5.46 5.67 5.77 5.78 5.81 5.83 5.85 ) if(HAVE_X11) diff --git a/src/plasma/version.cpp b/src/plasma/version.cpp index f6100e74d..9a5681538 100644 --- a/src/plasma/version.cpp +++ b/src/plasma/version.cpp @@ -8,6 +8,8 @@ #include #include +#if PLASMA_BUILD_DEPRECATED_SINCE(5, 85) + namespace Plasma { unsigned int version() @@ -60,3 +62,4 @@ bool isPluginVersionCompatible(unsigned int version) } } // Plasma namespace +#endif diff --git a/src/plasma/version.h b/src/plasma/version.h index c40790bf4..251f1e8a9 100644 --- a/src/plasma/version.h +++ b/src/plasma/version.h @@ -10,6 +10,9 @@ /** @file plasma/version.h */ #include + +#if PLASMA_ENABLE_DEPRECATED_SINCE(5, 85) + #include #define PLASMA_MAKE_VERSION(a, b, c) (((a) << 16) | ((b) << 8) | (c)) @@ -17,6 +20,7 @@ /** * Compile-time macro for checking the plasma version. Not useful for * detecting the version of libplasma at runtime. + * @deprecated Since 5.85, use plasma_version.h header instead */ #define PLASMA_IS_VERSION(a, b, c) (PLASMA_VERSION >= PLASMA_MAKE_VERSION(a, b, c)) @@ -27,34 +31,48 @@ namespace Plasma { /** * The runtime version of libplasma + * @deprecated Since 5.85, use plasma_version.h header instead */ +PLASMA_DEPRECATED_VERSION(5, 85, "use plasma_version.h header instead") PLASMA_EXPORT unsigned int version(); /** * The runtime major version of libplasma + * @deprecated Since 5.85, use plasma_version.h header instead */ +PLASMA_DEPRECATED_VERSION(5, 85, "use plasma_version.h header instead") PLASMA_EXPORT unsigned int versionMajor(); /** * The runtime major version of libplasma + * @deprecated Since 5.85, use plasma_version.h header instead */ +PLASMA_DEPRECATED_VERSION(5, 85, "use plasma_version.h header instead") PLASMA_EXPORT unsigned int versionMinor(); /** * The runtime major version of libplasma + * @deprecated Since 5.85, use plasma_version.h header instead */ +PLASMA_DEPRECATED_VERSION(5, 85, "use plasma_version.h header instead") PLASMA_EXPORT unsigned int versionRelease(); /** * The runtime version string of libplasma + * @deprecated Since 5.85, use plasma_version.h header instead */ +PLASMA_DEPRECATED_VERSION(5, 85, "use plasma_version.h header instead") PLASMA_EXPORT const char *versionString(); /** * Verifies that a plugin is compatible with plasma + * @deprecated Since 5.85, method is obsolete with the deprecation of KPluginLoader::pluginVersion. + * Consider using a versioned namespace or KPluginMetaData::version instead. */ +PLASMA_DEPRECATED_VERSION(5, 85, "See API docs") PLASMA_EXPORT bool isPluginVersionCompatible(unsigned int version); } // Plasma namespace +#endif #endif // multiple inclusion guard