From 263c5d48da428a4a78a5be97c6cbe895b0907fb8 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Mon, 30 May 2022 18:59:29 +0300 Subject: [PATCH] plasma: do not check plugins version Signed-off-by: Ivailo Monev --- plasma/abstracttoolbox.cpp | 6 +----- plasma/containmentactions.cpp | 5 ----- plasma/plasma.cpp | 17 ----------------- plasma/plasma.h | 5 +---- plasma/pluginloader.cpp | 22 +++------------------- plasma/runnermanager.cpp | 11 ++++------- plasma/wallpaper.cpp | 6 ------ 7 files changed, 9 insertions(+), 63 deletions(-) diff --git a/plasma/abstracttoolbox.cpp b/plasma/abstracttoolbox.cpp index 55e23231..295fddaa 100644 --- a/plasma/abstracttoolbox.cpp +++ b/plasma/abstracttoolbox.cpp @@ -63,11 +63,7 @@ AbstractToolBox *AbstractToolBox::load(const QString &name, const QVariantList & if (!offers.isEmpty()) { KService::Ptr offer = offers.first(); - - KPluginLoader plugin(*offer); - if (Plasma::isPluginCompatible(plugin.pluginName(), plugin.pluginVersion())) { - return offer->createInstance(containment, args); - } + return offer->createInstance(containment, args); } return 0; diff --git a/plasma/containmentactions.cpp b/plasma/containmentactions.cpp index db8e3233..99810c61 100644 --- a/plasma/containmentactions.cpp +++ b/plasma/containmentactions.cpp @@ -93,11 +93,6 @@ ContainmentActions *ContainmentActions::load(Containment *parent, const QString } KService::Ptr offer = offers.first(); - KPluginLoader plugin(*offer); - - if (!Plasma::isPluginCompatible(plugin.pluginName(), plugin.pluginVersion())) { - return 0; - } QVariantList allArgs; allArgs << offer->storageId() << args; diff --git a/plasma/plasma.cpp b/plasma/plasma.cpp index 096f0f99..fcc71811 100644 --- a/plasma/plasma.cpp +++ b/plasma/plasma.cpp @@ -140,21 +140,4 @@ QList actionsFromMenu(QMenu *menu, const QString &prefix, QObject *par return ret; } -bool isPluginCompatible(const QString &plugin, unsigned int version) -{ - if (!version) { - // unversioned, just let it through - kWarning() << "unversioned plugin" << plugin << "detected, may result in instability"; - return true; - } - - if (version < KDE_VERSION) { - kDebug() << "plugin" << plugin << "is compiled against incompatible Plasma version " << version - << "This build is compatible with" << KDE_VERSION_STRING; - return false; - } - - return true; -} - } // Plasma namespace diff --git a/plasma/plasma.h b/plasma/plasma.h index 4a6d86ad..8926ce51 100644 --- a/plasma/plasma.h +++ b/plasma/plasma.h @@ -306,10 +306,7 @@ PLASMA_EXPORT QGraphicsView *viewFor(const QGraphicsItem *item); PLASMA_EXPORT QList actionsFromMenu(QMenu *menu, const QString &prefix = QString(), QObject *parent = 0); -/** - * Verifies that a plugin is compatible with plasma - */ -PLASMA_EXPORT bool isPluginCompatible(const QString &plugin, unsigned int version); + } // Plasma namespace Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Constraints) diff --git a/plasma/pluginloader.cpp b/plasma/pluginloader.cpp index 0116f805..978e9b36 100644 --- a/plasma/pluginloader.cpp +++ b/plasma/pluginloader.cpp @@ -128,15 +128,6 @@ Applet *PluginLoader::loadApplet(const QString &name, uint appletId, const QVari } } - KPluginLoader plugin(*offer); - - if (!Plasma::isPluginCompatible(plugin.pluginName(), plugin.pluginVersion()) && - (name != "internal:extender")) { - return 0; - } - - - Applet *applet = 0; QString error; if (name == "internal:extender") { @@ -169,10 +160,7 @@ DataEngine *PluginLoader::loadDataEngine(const QString &name) QString api = offers.first()->property("X-Plasma-API").toString(); if (api.isEmpty()) { if (offers.first()) { - KPluginLoader plugin(*offers.first()); - if (Plasma::isPluginCompatible(plugin.pluginName(), plugin.pluginVersion())) { - engine = offers.first()->createInstance(0, allArgs, &error); - } + engine = offers.first()->createInstance(0, allArgs, &error); } } else { engine = new DataEngine(0, offers.first()); @@ -208,13 +196,9 @@ Service *PluginLoader::loadService(const QString &name, const QVariantList &args return new NullService(name, parent); } - Service *service = 0; - QString error; KService::Ptr offer = offers.first(); - KPluginLoader plugin(*offer); - if (Plasma::isPluginCompatible(plugin.pluginName(), plugin.pluginVersion())) { - service = offer->createInstance(parent, args, &error); - } + QString error; + Service *service = offer->createInstance(parent, args, &error); if (!service) { kDebug() << "Couldn't load Service \"" << name << "\"! reason given: " << error; diff --git a/plasma/runnermanager.cpp b/plasma/runnermanager.cpp index f52175e0..6cd41a2a 100644 --- a/plasma/runnermanager.cpp +++ b/plasma/runnermanager.cpp @@ -238,13 +238,10 @@ public: if (api.isEmpty()) { QVariantList args; args << service->storageId(); - KPluginLoader plugin(*service); - if (Plasma::isPluginCompatible(plugin.pluginName(), plugin.pluginVersion())) { - QString error; - runner = service->createInstance(q, args, &error); - if (!runner) { - kDebug() << "Failed to load runner:" << service->name() << ". error reported:" << error; - } + QString error; + runner = service->createInstance(q, args, &error); + if (!runner) { + kDebug() << "Failed to load runner:" << service->name() << ". error reported:" << error; } } else { //kDebug() << "got a script runner known as" << api; diff --git a/plasma/wallpaper.cpp b/plasma/wallpaper.cpp index 48349818..3fb22170 100644 --- a/plasma/wallpaper.cpp +++ b/plasma/wallpaper.cpp @@ -145,12 +145,6 @@ Wallpaper *Wallpaper::load(const QString &wallpaperName, const QVariantList &arg QVariantList allArgs; allArgs << offer->storageId() << args; - KPluginLoader plugin(*offer); - - if (!Plasma::isPluginCompatible(plugin.pluginName(), plugin.pluginVersion())) { - return 0; - } - QString error; Wallpaper *wallpaper = offer->createInstance(0, allArgs, &error);