summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-06 11:35:37 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-06 11:35:37 (GMT)
commit355fbd2bf8089da23eccd1e61c8a249c3ee90034 (patch)
treee407fa0f75134eae34346f77b98f051f05f75512
parent86cf94ecb7c71ab15afa072586370a36a49c3a0b (diff)
Load when plugin "isEnabledByDefault"
-rw-r--r--messagecomposer/src/plugineditor/plugineditormanager.cpp32
-rw-r--r--messageviewer/src/viewerplugins/viewerpluginmanager.cpp23
2 files changed, 29 insertions, 26 deletions
diff --git a/messagecomposer/src/plugineditor/plugineditormanager.cpp b/messagecomposer/src/plugineditor/plugineditormanager.cpp
index 2ec6057..9638ef5 100644
--- a/messagecomposer/src/plugineditor/plugineditormanager.cpp
+++ b/messagecomposer/src/plugineditor/plugineditormanager.cpp
@@ -96,22 +96,24 @@ bool PluginEditorManagerPrivate::initializePlugins()
while (i.hasPrevious()) {
PluginEditorInfo info;
info.metaData = i.previous();
- const QVariant p = info.metaData.rawData().value(QStringLiteral("X-KDE-KMailEditor-Order")).toVariant();
- int order = -1;
- if (p.isValid()) {
- order = p.toInt();
- }
- info.order = order;
- if (pluginVersion() == info.metaData.version()) {
- // only load plugins once, even if found multiple times!
- if (unique.contains(info.saveName())) {
- continue;
+ if (info.metaData.isEnabledByDefault()) {
+ const QVariant p = info.metaData.rawData().value(QStringLiteral("X-KDE-KMailEditor-Order")).toVariant();
+ int order = -1;
+ if (p.isValid()) {
+ order = p.toInt();
+ }
+ info.order = order;
+ 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(MESSAGECOMPOSER_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(MESSAGECOMPOSER_LOG) << "Plugin " << info.metaData.name() << " doesn't have correction plugin version. It will not be loaded.";
}
}
QVector<PluginEditorInfo>::iterator end(mPluginList.end());
diff --git a/messageviewer/src/viewerplugins/viewerpluginmanager.cpp b/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
index 8a8d77d..1406f32 100644
--- a/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
+++ b/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
@@ -115,18 +115,19 @@ bool ViewerPluginManagerPrivate::initializePluginList()
while (i.hasPrevious()) {
ViewerPluginInfo info;
info.metaData = i.previous();
-
- const QString version = info.metaData.version();
- if (pluginVersion() == version) {
- // only load plugins once, even if found multiple times!
- if (unique.contains(info.saveName())) {
- continue;
+ if (info.metaData.isEnabledByDefault()) {
+ const QString version = info.metaData.version();
+ if (pluginVersion() == 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(MESSAGEVIEWER_LOG) << "Plugin name :" << info.metaData.name() << " doesn't have correct plugin version. Please update it";
}
- info.plugin = Q_NULLPTR;
- mPluginList.push_back(info);
- unique.insert(info.saveName());
- } else {
- qCWarning(MESSAGEVIEWER_LOG) << "Plugin name :" << info.metaData.name() << " doesn't have correct plugin version. Please update it";
}
}
QVector<ViewerPluginInfo>::iterator end(mPluginList.end());