Paste P424

Masterwork From Distant Lands
ActivePublic

Authored by davidedmundson on Jul 3 2019, 5:58 AM.
diff --git a/src/plasma/pluginloader.cpp b/src/plasma/pluginloader.cpp
index 298c89a53..3afbcb7d5 100644
--- a/src/plasma/pluginloader.cpp
+++ b/src/plasma/pluginloader.cpp
@@ -278,24 +278,39 @@ DataEngine *PluginLoader::loadDataEngine(const QString &name)
return engine;
}
- // Look for C++ plugins first
- auto filter = [&name](const KPluginMetaData &md) -> bool
- {
- return md.pluginId() == name;
- };
- QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(PluginLoaderPrivate::s_dataEnginePluginDir, filter);
-
- if (!plugins.isEmpty()) {
- KPluginLoader loader(plugins.first().fileName());
- const QVariantList argsWithMetaData = QVariantList() << loader.metaData().toVariantMap();
+ KPluginLoader loader(PluginLoaderPrivate::s_dataEnginePluginDir + QStringLiteral("/plasma_engine_") + name + QStringLiteral(".so"));
+ if (loader.load()) {
KPluginFactory *factory = loader.factory();
if (factory) {
+ //what on Earth is the point of sending metadata from the plugin ...to the plugin??!
+ const QVariantList argsWithMetaData = QVariantList() << loader.metaData().toVariantMap();
engine = factory->create<Plasma::DataEngine>(nullptr, argsWithMetaData);
}
+ if (engine) {
+ qDebug() << "NAILED IT!!!";
+ return engine;
+ }
}
- if (engine) {
- return engine;
- }
+
+ //then this stuff can die in a fire, or just become a fallback?
+// // Look for C++ plugins first
+// auto filter = [&name](const KPluginMetaData &md) -> bool
+// {
+// return md.pluginId() == name;
+// };
+// QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(PluginLoaderPrivate::s_dataEnginePluginDir, filter);
+//
+// if (!plugins.isEmpty()) {
+// KPluginLoader loader(plugins.first().fileName());
+// const QVariantList argsWithMetaData = QVariantList() << loader.metaData().toVariantMap();
+// KPluginFactory *factory = loader.factory();
+// if (factory) {
+// engine = factory->create<Plasma::DataEngine>(nullptr, argsWithMetaData);
+// }
+// }
+// if (engine) {
+// return engine;
+// }
const KPackage::Package p = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("Plasma/DataEngine"), name);
if (!p.isValid()) {
davidedmundson edited the content of this paste. (Show Details)Jul 3 2019, 5:58 AM
davidedmundson changed the title of this paste from untitled to Masterwork From Distant Lands.