mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +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()) {
|
if (!offers.isEmpty()) {
|
||||||
KService::Ptr offer = offers.first();
|
KService::Ptr offer = offers.first();
|
||||||
|
return offer->createInstance<AbstractToolBox>(containment, args);
|
||||||
KPluginLoader plugin(*offer);
|
|
||||||
if (Plasma::isPluginCompatible(plugin.pluginName(), plugin.pluginVersion())) {
|
|
||||||
return offer->createInstance<AbstractToolBox>(containment, args);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -93,11 +93,6 @@ ContainmentActions *ContainmentActions::load(Containment *parent, const QString
|
||||||
}
|
}
|
||||||
|
|
||||||
KService::Ptr offer = offers.first();
|
KService::Ptr offer = offers.first();
|
||||||
KPluginLoader plugin(*offer);
|
|
||||||
|
|
||||||
if (!Plasma::isPluginCompatible(plugin.pluginName(), plugin.pluginVersion())) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
QVariantList allArgs;
|
QVariantList allArgs;
|
||||||
allArgs << offer->storageId() << args;
|
allArgs << offer->storageId() << args;
|
||||||
|
|
|
@ -140,21 +140,4 @@ QList<QAction*> actionsFromMenu(QMenu *menu, const QString &prefix, QObject *par
|
||||||
return ret;
|
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
|
} // Plasma namespace
|
||||||
|
|
|
@ -306,10 +306,7 @@ PLASMA_EXPORT QGraphicsView *viewFor(const QGraphicsItem *item);
|
||||||
PLASMA_EXPORT QList<QAction*> actionsFromMenu(QMenu *menu,
|
PLASMA_EXPORT QList<QAction*> actionsFromMenu(QMenu *menu,
|
||||||
const QString &prefix = QString(),
|
const QString &prefix = QString(),
|
||||||
QObject *parent = 0);
|
QObject *parent = 0);
|
||||||
/**
|
|
||||||
* Verifies that a plugin is compatible with plasma
|
|
||||||
*/
|
|
||||||
PLASMA_EXPORT bool isPluginCompatible(const QString &plugin, unsigned int version);
|
|
||||||
} // Plasma namespace
|
} // Plasma namespace
|
||||||
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Constraints)
|
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;
|
Applet *applet = 0;
|
||||||
QString error;
|
QString error;
|
||||||
if (name == "internal:extender") {
|
if (name == "internal:extender") {
|
||||||
|
@ -169,10 +160,7 @@ DataEngine *PluginLoader::loadDataEngine(const QString &name)
|
||||||
QString api = offers.first()->property("X-Plasma-API").toString();
|
QString api = offers.first()->property("X-Plasma-API").toString();
|
||||||
if (api.isEmpty()) {
|
if (api.isEmpty()) {
|
||||||
if (offers.first()) {
|
if (offers.first()) {
|
||||||
KPluginLoader plugin(*offers.first());
|
engine = offers.first()->createInstance<Plasma::DataEngine>(0, allArgs, &error);
|
||||||
if (Plasma::isPluginCompatible(plugin.pluginName(), plugin.pluginVersion())) {
|
|
||||||
engine = offers.first()->createInstance<Plasma::DataEngine>(0, allArgs, &error);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
engine = new DataEngine(0, offers.first());
|
engine = new DataEngine(0, offers.first());
|
||||||
|
@ -208,13 +196,9 @@ Service *PluginLoader::loadService(const QString &name, const QVariantList &args
|
||||||
return new NullService(name, parent);
|
return new NullService(name, parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
Service *service = 0;
|
|
||||||
QString error;
|
|
||||||
KService::Ptr offer = offers.first();
|
KService::Ptr offer = offers.first();
|
||||||
KPluginLoader plugin(*offer);
|
QString error;
|
||||||
if (Plasma::isPluginCompatible(plugin.pluginName(), plugin.pluginVersion())) {
|
Service *service = offer->createInstance<Plasma::Service>(parent, args, &error);
|
||||||
service = offer->createInstance<Plasma::Service>(parent, args, &error);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!service) {
|
if (!service) {
|
||||||
kDebug() << "Couldn't load Service \"" << name << "\"! reason given: " << error;
|
kDebug() << "Couldn't load Service \"" << name << "\"! reason given: " << error;
|
||||||
|
|
|
@ -238,13 +238,10 @@ public:
|
||||||
if (api.isEmpty()) {
|
if (api.isEmpty()) {
|
||||||
QVariantList args;
|
QVariantList args;
|
||||||
args << service->storageId();
|
args << service->storageId();
|
||||||
KPluginLoader plugin(*service);
|
QString error;
|
||||||
if (Plasma::isPluginCompatible(plugin.pluginName(), plugin.pluginVersion())) {
|
runner = service->createInstance<AbstractRunner>(q, args, &error);
|
||||||
QString error;
|
if (!runner) {
|
||||||
runner = service->createInstance<AbstractRunner>(q, args, &error);
|
kDebug() << "Failed to load runner:" << service->name() << ". error reported:" << error;
|
||||||
if (!runner) {
|
|
||||||
kDebug() << "Failed to load runner:" << service->name() << ". error reported:" << error;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//kDebug() << "got a script runner known as" << api;
|
//kDebug() << "got a script runner known as" << api;
|
||||||
|
|
|
@ -145,12 +145,6 @@ Wallpaper *Wallpaper::load(const QString &wallpaperName, const QVariantList &arg
|
||||||
QVariantList allArgs;
|
QVariantList allArgs;
|
||||||
allArgs << offer->storageId() << args;
|
allArgs << offer->storageId() << args;
|
||||||
|
|
||||||
KPluginLoader plugin(*offer);
|
|
||||||
|
|
||||||
if (!Plasma::isPluginCompatible(plugin.pluginName(), plugin.pluginVersion())) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString error;
|
QString error;
|
||||||
Wallpaper *wallpaper = offer->createInstance<Plasma::Wallpaper>(0, allArgs, &error);
|
Wallpaper *wallpaper = offer->createInstance<Plasma::Wallpaper>(0, allArgs, &error);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue