kdecore: remove now unused KPluginLoader::pluginVersion() method

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-05-30 18:59:56 +03:00
parent 263c5d48da
commit 623cc24741
3 changed files with 2 additions and 54 deletions

View file

@ -24,34 +24,6 @@
#include <QtCore/QPluginLoader>
#include <QtCore/qplugin.h>
/**
* \internal
* Stores KDE version information in a plugin library.
* \see K_PLUGIN_VERIFICATION_DATA
*/
struct KDEPluginVerificationData
{
enum { PluginVerificationDataVersion = 1 };
/**
* \internal
* The version of this structure. Do not ever delete or change a field.
* append a field to this structure.
*/
quint8 dataVersion;
quint32 KDEVersion;
const char *KDEVersionString;
};
/**
* \internal
* Used to export the KDE version a plugin was compiled against.
* \see KDEPluginVerificationData
*/
#define K_PLUGIN_VERIFICATION_DATA \
extern "C" Q_DECL_EXPORT const KDEPluginVerificationData kde_plugin_verification_data = \
{ KDEPluginVerificationData::PluginVerificationDataVersion, KDE_VERSION, KDE_VERSION_STRING };
/**
* \relates KPluginLoader
* This macro exports the main object of the plugin. Most times, this will be a KPluginFactory
@ -59,8 +31,7 @@ extern "C" Q_DECL_EXPORT const KDEPluginVerificationData kde_plugin_verification
* Take a look at the documentation of Q_EXPORT_PLUGIN2 for some details.
*/
#define K_EXPORT_PLUGIN(factory) \
Q_EXPORT_PLUGIN(factory) \
K_PLUGIN_VERIFICATION_DATA
Q_EXPORT_PLUGIN(factory)
#endif // KDECORE_KEXPORTPLUGIN_H

View file

@ -34,14 +34,13 @@ class KPluginLoaderPrivate
{
public:
KPluginLoaderPrivate(const QString &libname)
: name(libname), pluginVersion(0)
: name(libname)
{}
~KPluginLoaderPrivate()
{
}
const QString name;
mutable quint32 pluginVersion;
QString errorString;
};
@ -177,22 +176,6 @@ QString KPluginLoader::errorString() const
return QPluginLoader::errorString();
}
quint32 KPluginLoader::pluginVersion() const
{
Q_D(const KPluginLoader);
if (!d->pluginVersion && !fileName().isEmpty()) {
QLibrary lib(fileName());
KDEPluginVerificationData *verificationData = (KDEPluginVerificationData *) lib.resolve("kde_plugin_verification_data");
if (verificationData) {
d->pluginVersion = (verificationData->KDEVersion & 0xFFFF00);
}
}
return d->pluginVersion;
}
QString KPluginLoader::pluginName() const
{
Q_D(const KPluginLoader);

View file

@ -122,12 +122,6 @@ public:
*/
QString pluginName() const;
/**
* Queries the plugin version.
* \returns The version defined as KDE_VERSION or (quint32) 0 if plugin is not valid KDE plugin.
*/
quint32 pluginVersion() const;
/**
* Queries the last error.
* \returns The description of the last error.