mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
plasma: do not check plugins version
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
f8a872e6b5
commit
263c5d48da
7 changed files with 9 additions and 63 deletions
|
@ -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<AbstractToolBox>(containment, args);
|
||||
}
|
||||
return offer->createInstance<AbstractToolBox>(containment, args);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -140,21 +140,4 @@ QList<QAction*> 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
|
||||
|
|
|
@ -306,10 +306,7 @@ PLASMA_EXPORT QGraphicsView *viewFor(const QGraphicsItem *item);
|
|||
PLASMA_EXPORT QList<QAction*> 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)
|
||||
|
|
|
@ -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<Plasma::DataEngine>(0, allArgs, &error);
|
||||
}
|
||||
engine = offers.first()->createInstance<Plasma::DataEngine>(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<Plasma::Service>(parent, args, &error);
|
||||
}
|
||||
QString error;
|
||||
Service *service = offer->createInstance<Plasma::Service>(parent, args, &error);
|
||||
|
||||
if (!service) {
|
||||
kDebug() << "Couldn't load Service \"" << name << "\"! reason given: " << error;
|
||||
|
|
|
@ -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<AbstractRunner>(q, args, &error);
|
||||
if (!runner) {
|
||||
kDebug() << "Failed to load runner:" << service->name() << ". error reported:" << error;
|
||||
}
|
||||
QString error;
|
||||
runner = service->createInstance<AbstractRunner>(q, args, &error);
|
||||
if (!runner) {
|
||||
kDebug() << "Failed to load runner:" << service->name() << ". error reported:" << error;
|
||||
}
|
||||
} else {
|
||||
//kDebug() << "got a script runner known as" << api;
|
||||
|
|
|
@ -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<Plasma::Wallpaper>(0, allArgs, &error);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue