Commit 14402f27 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Remove check about unique plugin (already done in kcoreaddons now)

parent c8abe150
Pipeline #66020 passed with stage
in 41 minutes and 4 seconds
......@@ -70,7 +70,6 @@ void PluginEditorManagerPrivate::initializePlugins()
QVectorIterator<KPluginMetaData> i(plugins);
i.toBack();
QSet<QString> unique;
while (i.hasPrevious()) {
PluginEditorInfo info;
const KPluginMetaData data = i.previous();
......@@ -90,13 +89,8 @@ void PluginEditorManagerPrivate::initializePlugins()
}
info.order = order;
if (pluginEditorVersion() == data.version()) {
// only load plugins once, even if found multiple times!
if (unique.contains(info.metaDataFileNameBaseName)) {
continue;
}
info.plugin = nullptr;
mPluginList.push_back(info);
unique.insert(info.metaDataFileNameBaseName);
} else {
qCWarning(MESSAGECOMPOSER_LOG) << "Plugin " << data.name() << " doesn't have correction plugin version. It will not be loaded.";
}
......
......@@ -83,7 +83,6 @@ void PluginEditorCheckBeforeSendManagerPrivate::initializePlugins()
QVectorIterator<KPluginMetaData> i(plugins);
i.toBack();
QSet<QString> unique;
while (i.hasPrevious()) {
PluginEditorCheckBeforeSendInfo info;
const KPluginMetaData data = i.previous();
......@@ -97,13 +96,8 @@ void PluginEditorCheckBeforeSendManagerPrivate::initializePlugins()
info.metaDataFileNameBaseName = QFileInfo(data.fileName()).baseName();
info.metaDataFileName = data.fileName();
if (pluginVersion() == data.version()) {
// only load plugins once, even if found multiple times!
if (unique.contains(info.metaDataFileNameBaseName)) {
continue;
}
info.plugin = nullptr;
mPluginList.push_back(info);
unique.insert(info.metaDataFileNameBaseName);
} else {
qCWarning(MESSAGECOMPOSER_LOG) << "Plugin " << data.name() << " doesn't have correction plugin version. It will not be loaded.";
}
......
......@@ -83,7 +83,6 @@ void PluginEditorConvertTextManagerPrivate::initializePlugins()
QVectorIterator<KPluginMetaData> i(plugins);
i.toBack();
QSet<QString> unique;
while (i.hasPrevious()) {
PluginEditorConvertTextInfo info;
const KPluginMetaData data = i.previous();
......@@ -97,13 +96,8 @@ void PluginEditorConvertTextManagerPrivate::initializePlugins()
info.metaDataFileNameBaseName = QFileInfo(data.fileName()).baseName();
info.metaDataFileName = data.fileName();
if (pluginVersion() == data.version()) {
// only load plugins once, even if found multiple times!
if (unique.contains(info.metaDataFileNameBaseName)) {
continue;
}
info.plugin = nullptr;
mPluginList.push_back(info);
unique.insert(info.metaDataFileNameBaseName);
} else {
qCWarning(MESSAGECOMPOSER_LOG) << "Plugin " << data.name() << " doesn't have correction plugin version. It will not be loaded.";
}
......
......@@ -84,7 +84,6 @@ void PluginEditorGrammarManagerPrivate::initializePlugins()
QVectorIterator<KPluginMetaData> i(plugins);
i.toBack();
QSet<QString> unique;
while (i.hasPrevious()) {
PluginEditorGrammarInfo info;
const KPluginMetaData data = i.previous();
......@@ -98,13 +97,8 @@ void PluginEditorGrammarManagerPrivate::initializePlugins()
info.metaDataFileNameBaseName = QFileInfo(data.fileName()).baseName();
info.metaDataFileName = data.fileName();
if (pluginEditorGrammarVersion() == data.version()) {
// only load plugins once, even if found multiple times!
if (unique.contains(info.metaDataFileNameBaseName)) {
continue;
}
info.plugin = nullptr;
mPluginList.push_back(info);
unique.insert(info.metaDataFileNameBaseName);
} else {
qCWarning(MESSAGECOMPOSER_LOG) << "Plugin " << data.name() << " doesn't have correction plugin version. It will not be loaded.";
}
......
......@@ -83,7 +83,6 @@ void PluginEditorInitManagerPrivate::initializePlugins()
QVectorIterator<KPluginMetaData> i(plugins);
i.toBack();
QSet<QString> unique;
while (i.hasPrevious()) {
PluginEditorInitInfo info;
const KPluginMetaData data = i.previous();
......@@ -97,13 +96,8 @@ void PluginEditorInitManagerPrivate::initializePlugins()
info.metaDataFileNameBaseName = QFileInfo(data.fileName()).baseName();
info.metaDataFileName = data.fileName();
if (pluginVersion() == data.version()) {
// only load plugins once, even if found multiple times!
if (unique.contains(info.metaDataFileNameBaseName)) {
continue;
}
info.plugin = nullptr;
mPluginList.push_back(info);
unique.insert(info.metaDataFileNameBaseName);
} else {
qCWarning(MESSAGECOMPOSER_LOG) << "Plugin " << data.name() << " doesn't have correction plugin version. It will not be loaded.";
}
......
......@@ -81,7 +81,6 @@ void HeaderStylePluginManagerPrivate::initializePluginList()
QVectorIterator<KPluginMetaData> i(plugins);
i.toBack();
const QPair<QStringList, QStringList> pair = PimCommon::PluginUtil::loadPluginSetting(configGroupName(), configPrefixSettingKey());
QSet<QString> unique;
QVector<int> listOrder;
while (i.hasPrevious()) {
HeaderStylePluginInfo info;
......@@ -98,10 +97,6 @@ void HeaderStylePluginManagerPrivate::initializePluginList()
info.metaDataFileName = data.fileName();
const QString version = data.version();
if (pluginVersion() == version) {
// only load plugins once, even if found multiple times!
if (unique.contains(info.metaDataFileNameBaseName)) {
continue;
}
const QVariant p = data.rawData().value(QStringLiteral("X-KDE-MessageViewer-Header-Order")).toVariant();
int order = -1;
if (p.isValid()) {
......@@ -118,7 +113,6 @@ void HeaderStylePluginManagerPrivate::initializePluginList()
listOrder.insert(pos, order);
info.plugin = nullptr;
mPluginList.insert(pos, info);
unique.insert(info.metaDataFileNameBaseName);
} else {
qCWarning(MESSAGEVIEWER_LOG) << "Plugin " << data.name() << " doesn't have correction plugin version. It will not be loaded.";
}
......
......@@ -80,7 +80,6 @@ void MessageViewerConfigureSettingsPluginManagerPrivate::initializePluginList()
QVectorIterator<KPluginMetaData> i(plugins);
i.toBack();
const QPair<QStringList, QStringList> pair = PimCommon::PluginUtil::loadPluginSetting(configGroupName(), configPrefixSettingKey());
QSet<QString> unique;
QVector<int> listOrder;
while (i.hasPrevious()) {
ConfigureSettingsPluginInfo info;
......@@ -94,10 +93,6 @@ void MessageViewerConfigureSettingsPluginManagerPrivate::initializePluginList()
info.metaDataFileName = data.fileName();
const QString version = data.version();
if (pluginVersion() == version) {
// only load plugins once, even if found multiple times!
if (unique.contains(info.metaDataFileNameBaseName)) {
continue;
}
const QVariant p = data.rawData().value(QStringLiteral("X-KDE-MessageViewer-Configure-Order")).toVariant();
int order = -1;
if (p.isValid()) {
......@@ -114,7 +109,6 @@ void MessageViewerConfigureSettingsPluginManagerPrivate::initializePluginList()
listOrder.insert(pos, order);
info.plugin = nullptr;
mPluginList.insert(pos, info);
unique.insert(info.metaDataFileNameBaseName);
} else {
qCWarning(MESSAGEVIEWER_LOG) << "Plugin " << data.name() << " doesn't have correction plugin version. It will not be loaded.";
}
......
......@@ -92,7 +92,6 @@ bool ViewerPluginManagerPrivate::initializePluginList()
const QPair<QStringList, QStringList> pair = PimCommon::PluginUtil::loadPluginSetting(configGroupName(), configPrefixSettingKey());
QVectorIterator<KPluginMetaData> i(plugins);
i.toBack();
QSet<QString> unique;
while (i.hasPrevious()) {
ViewerPluginInfo info;
......@@ -108,13 +107,8 @@ bool ViewerPluginManagerPrivate::initializePluginList()
info.metaDataFileName = data.fileName();
if (pluginVersion() == data.version()) {
// only load plugins once, even if found multiple times!
if (unique.contains(info.metaDataFileNameBaseName)) {
continue;
}
info.plugin = nullptr;
mPluginList.push_back(info);
unique.insert(info.metaDataFileNameBaseName);
} else {
qCWarning(MESSAGEVIEWER_LOG) << "Plugin name :" << data.name() << " doesn't have correct plugin version. Please update it";
}
......
......@@ -83,7 +83,6 @@ void NetworkUrlInterceptorPluginManagerPrivate::initializePluginList()
QVectorIterator<KPluginMetaData> i(plugins);
i.toBack();
QSet<QString> unique;
const QPair<QStringList, QStringList> pair = PimCommon::PluginUtil::loadPluginSetting(configGroupName(), configPrefixSettingKey());
while (i.hasPrevious()) {
......@@ -101,13 +100,8 @@ void NetworkUrlInterceptorPluginManagerPrivate::initializePluginList()
info.metaDataFileName = data.fileName();
if (pluginVersion() == data.version()) {
// only load plugins once, even if found multiple times!
if (unique.contains(info.metaDataFileNameBaseName)) {
continue;
}
info.plugin = nullptr;
mPluginList.push_back(info);
unique.insert(info.metaDataFileNameBaseName);
} else {
qCWarning(WEBENGINEVIEWER_LOG) << "Plugin " << data.name() << " doesn't have correction plugin version. It will not be loaded.";
}
......
Markdown is supported
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