Use KPluginTrader to load dataengine

This commit is contained in:
Sebastian Kügler 2013-09-12 02:29:09 +02:00
parent 5e845c7c4b
commit cd5be142ed

View File

@ -250,12 +250,9 @@ DataEngine *PluginLoader::loadDataEngine(const QString &name)
allArgs << offers.first()->storageId();
QString api = offers.first()->property("X-Plasma-API").toString();
if (api.isEmpty()) {
if (offers.first()) {
KPluginLoader plugin(*offers.first());
if (Plasma::isPluginVersionCompatible(plugin.pluginVersion())) {
engine = offers.first()->createInstance<Plasma::DataEngine>(0, allArgs, &error);
}
}
engine = KPluginTrader::createInstanceFromQuery<Plasma::DataEngine>("Plasma/DataEngine",
d->pluginDir,
constraint, 0);
} else {
engine = new DataEngine(KPluginInfo(offers.first()), 0);
}