pluginloader: Remove deprecated version checks

Task: https://phabricator.kde.org/T14302

The explicit version checks are not needed anymore, the plugins are
installed into a specific namespace for each major version. Also the
plasma-frameworks API is stable during the lifetime of a major version.
This commit is contained in:
Alexander Lohnau 2021-06-02 18:51:49 +02:00
parent a81a78becd
commit b63335d10a
2 changed files with 0 additions and 35 deletions

View File

@ -188,9 +188,6 @@ Applet *PluginLoader::loadApplet(const QString &name, uint appletId, const QVari
if (!plugins.isEmpty()) {
KPluginLoader loader(plugins.first().fileName());
if (!isPluginVersionCompatible(loader)) {
return nullptr;
}
KPluginFactory *factory = loader.factory();
if (factory) {
QVariantList allArgs;
@ -334,9 +331,6 @@ Service *PluginLoader::loadService(const QString &name, const QVariantList &args
if (!plugins.isEmpty()) {
KPluginLoader loader(plugins.first().fileName());
if (!isPluginVersionCompatible(loader)) {
return nullptr;
}
KPluginFactory *factory = loader.factory();
if (factory) {
service = factory->create<Plasma::Service>(nullptr, args);
@ -392,10 +386,6 @@ ContainmentActions *PluginLoader::loadContainmentActions(Containment *parent, co
KService::Ptr offer = offers.first();
KPluginLoader plugin(*offer);
if (!isPluginVersionCompatible(plugin)) {
return nullptr;
}
QVariantList allArgs;
allArgs << offer->storageId() << args;
QString error;
@ -921,29 +911,6 @@ KPluginInfo::List PluginLoader::standardInternalServiceInfo() const
return standardInternalInfo(QStringLiteral("services"));
}
bool PluginLoader::isPluginVersionCompatible(KPluginLoader &loader)
{
const quint32 version = loader.pluginVersion();
if (version == quint32(-1)) {
// unversioned, just let it through
qCWarning(LOG_PLASMA) << loader.fileName() << "unversioned plugin detected, may result in instability";
return true;
}
// we require PLASMA_VERSION_MAJOR and PLASMA_VERSION_MINOR
const quint32 minVersion = PLASMA_MAKE_VERSION(PLASMA_VERSION_MAJOR, 0, 0);
const quint32 maxVersion = PLASMA_MAKE_VERSION(PLASMA_VERSION_MAJOR, PLASMA_VERSION_MINOR, 60);
if (version < minVersion || version > maxVersion) {
qCWarning(LOG_PLASMA) << loader.fileName() << ": this plugin is compiled against incompatible Plasma version" << version
<< "This build is compatible with" << PLASMA_VERSION_MAJOR << ".0.0 (" << minVersion << ") to" << PLASMA_VERSION_STRING << "("
<< maxVersion << ")";
return false;
}
return true;
}
QVector<KPluginMetaData> PluginLoaderPrivate::Cache::findPluginsById(const QString &name, const QStringList &dirs)
{
const qint64 now = qRound64(QDateTime::currentMSecsSinceEpoch() / 1000.0);

View File

@ -577,8 +577,6 @@ protected:
virtual ~PluginLoader();
private:
bool isPluginVersionCompatible(KPluginLoader &loader);
PluginLoaderPrivate *const d;
};