summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-06 11:36:42 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-06 11:36:42 (GMT)
commit6eaa9b89e2cb42b2689110d7c160a084da416936 (patch)
treea490d3f87e248b52ee8558e09556a5e569674beb
parent282cec8151f9d6bda3664f4cad11e926e1f72061 (diff)
Load when isEnabledByDefault
-rw-r--r--src/genericplugins/genericpluginmanager.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/genericplugins/genericpluginmanager.cpp b/src/genericplugins/genericpluginmanager.cpp
index 3cb1d4d..3a851c1 100644
--- a/src/genericplugins/genericpluginmanager.cpp
+++ b/src/genericplugins/genericpluginmanager.cpp
@@ -104,23 +104,24 @@ bool GenericPluginManagerPrivate::initializePlugins()
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(pluginName, [](const KPluginMetaData & md) {
return md.serviceTypes().contains(s_serviceTypeName);
});
-
QVectorIterator<KPluginMetaData> i(plugins);
i.toBack();
QSet<QString> unique;
while (i.hasPrevious()) {
GenericPluginInfo info;
info.metaData = i.previous();
- if (pluginVersion() == info.metaData.version()) {
- // only load plugins once, even if found multiple times!
- if (unique.contains(info.saveName())) {
- continue;
+ if (info.metaData.isEnabledByDefault()) {
+ if (pluginVersion() == info.metaData.version()) {
+ // only load plugins once, even if found multiple times!
+ if (unique.contains(info.saveName())) {
+ continue;
+ }
+ info.plugin = Q_NULLPTR;
+ mPluginList.push_back(info);
+ unique.insert(info.saveName());
+ } else {
+ qCWarning(PIMCOMMON_LOG) << "Plugin " << info.metaData.name() << " doesn't have correction plugin version. It will not be loaded.";
}
- info.plugin = Q_NULLPTR;
- mPluginList.push_back(info);
- unique.insert(info.saveName());
- } else {
- qCWarning(PIMCOMMON_LOG) << "Plugin " << info.metaData.name() << " doesn't have correction plugin version. It will not be loaded.";
}
}
QVector<GenericPluginInfo>::iterator end(mPluginList.end());