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
This commit is contained in:
Alexander Lohnau 2021-07-20 09:44:50 +02:00
parent 882442bce3
commit 75c31c08d5
No known key found for this signature in database
GPG Key ID: 1F58708D54A003E7
3 changed files with 22 additions and 1 deletions

View File

@ -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)

View File

@ -8,6 +8,8 @@
#include <QDebug>
#include <plasma/version.h>
#if PLASMA_BUILD_DEPRECATED_SINCE(5, 85)
namespace Plasma
{
unsigned int version()
@ -60,3 +62,4 @@ bool isPluginVersionCompatible(unsigned int version)
}
} // Plasma namespace
#endif

View File

@ -10,6 +10,9 @@
/** @file plasma/version.h <Plasma/Version> */
#include <plasma/plasma_export.h>
#if PLASMA_ENABLE_DEPRECATED_SINCE(5, 85)
#include <plasma_version.h>
#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