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()
#else
const QVector<KPluginMetaData> plugins = KPluginMetaData::findPlugins(m_pluginSubdir);
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()) {
qCWarning(MESSAGEVIEWER_LOG) << "Plugin" << md.fileName() << "has no meta data.";
return;
continue;
}
QPluginLoader loader(md.fileName());
auto plugin = qobject_cast<MessagePartRenderPlugin *>(loader.instance());
if (!plugin) {
qCWarning(MESSAGEVIEWER_LOG) << md.fileName() << "is not a MessagePartRendererPlugin";
return;
continue;
}
MessagePartRendererBase *renderer = nullptr;
......
......@@ -172,14 +172,14 @@ void BodyPartFormatterFactory::loadPlugins()
#else
const QVector<KPluginMetaData> plugins = KPluginMetaData::findPlugins(QStringLiteral("messageviewer/bodypartformatter"));
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()) {
return;
continue;
}
QPluginLoader loader(md.fileName());
auto plugin = qobject_cast<MimeTreeParser::Interface::BodyPartFormatterPlugin *>(loader.instance());
if (!plugin) {
return;
continue;
}
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