Commit 11c980b4 authored by Volker Krause's avatar Volker Krause
Browse files

Unbreak body part formatter plugin loading

This broke as part of the port to the new plugin loader API, apparently
the semantics of the meta data API changed slightly.
parent 57d708c7
Pipeline #76157 passed with stage
in 42 minutes and 23 seconds
...@@ -91,16 +91,16 @@ void MessagePartRendererFactoryPrivate::loadPlugins() ...@@ -91,16 +91,16 @@ void MessagePartRendererFactoryPrivate::loadPlugins()
#else #else
const QVector<KPluginMetaData> plugins = KPluginMetaData::findPlugins(m_pluginSubdir); const QVector<KPluginMetaData> plugins = KPluginMetaData::findPlugins(m_pluginSubdir);
for (const auto &md : plugins) { for (const auto &md : plugins) {
const auto pluginData = md.rawData().value(QLatin1String("MetaData")).toObject().value(QLatin1String("renderer")).toArray(); const auto pluginData = md.rawData().value(QLatin1String("renderer")).toArray();
if (pluginData.isEmpty()) { if (pluginData.isEmpty()) {
qCWarning(MESSAGEVIEWER_LOG) << "Plugin" << md.fileName() << "has no meta data."; qCWarning(MESSAGEVIEWER_LOG) << "Plugin" << md.fileName() << "has no meta data.";
return; continue;
} }
QPluginLoader loader(md.fileName()); QPluginLoader loader(md.fileName());
auto plugin = qobject_cast<MessagePartRenderPlugin *>(loader.instance()); auto plugin = qobject_cast<MessagePartRenderPlugin *>(loader.instance());
if (!plugin) { if (!plugin) {
qCWarning(MESSAGEVIEWER_LOG) << md.fileName() << "is not a MessagePartRendererPlugin"; qCWarning(MESSAGEVIEWER_LOG) << md.fileName() << "is not a MessagePartRendererPlugin";
return; continue;
} }
MessagePartRendererBase *renderer = nullptr; MessagePartRendererBase *renderer = nullptr;
......
...@@ -172,14 +172,14 @@ void BodyPartFormatterFactory::loadPlugins() ...@@ -172,14 +172,14 @@ void BodyPartFormatterFactory::loadPlugins()
#else #else
const QVector<KPluginMetaData> plugins = KPluginMetaData::findPlugins(QStringLiteral("messageviewer/bodypartformatter")); const QVector<KPluginMetaData> plugins = KPluginMetaData::findPlugins(QStringLiteral("messageviewer/bodypartformatter"));
for (const auto &md : plugins) { for (const auto &md : plugins) {
const auto formatterData = md.rawData().value(QLatin1String("MetaData")).toObject().value(QLatin1String("formatter")).toArray(); const auto formatterData = md.rawData().value(QLatin1String("formatter")).toArray();
if (formatterData.isEmpty()) { if (formatterData.isEmpty()) {
return; continue;
} }
QPluginLoader loader(md.fileName()); QPluginLoader loader(md.fileName());
auto plugin = qobject_cast<MimeTreeParser::Interface::BodyPartFormatterPlugin *>(loader.instance()); auto plugin = qobject_cast<MimeTreeParser::Interface::BodyPartFormatterPlugin *>(loader.instance());
if (!plugin) { if (!plugin) {
return; continue;
} }
const MimeTreeParser::Interface::BodyPartFormatter *bfp = nullptr; const MimeTreeParser::Interface::BodyPartFormatter *bfp = nullptr;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment