summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-08 05:54:46 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-08 05:54:46 (GMT)
commit37c1120d70426a9e62dd9ae35faf946415a09ade (patch)
treead72a5206c64efb9fbddd27161e867790e5fc471
parent7d1a6188146ccc07806064c16ffbfde385aa7351 (diff)
Use PimCommon::PluginUtil::isPluginActivated
-rw-r--r--CMakeLists.txt2
-rw-r--r--messageviewer/src/viewerplugins/viewerpluginmanager.cpp7
2 files changed, 4 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3ef9670..844dfb7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,7 +39,7 @@ set(KMIME_LIB_VERSION "5.3.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.3.43")
set(LIBKDEPIM_LIB_VERSION "5.3.42")
set(LIBKLEO_LIB_VERSION "5.3.40")
-set(PIMCOMMON_LIB_VERSION "5.3.41")
+set(PIMCOMMON_LIB_VERSION "5.3.44")
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test Network PrintSupport WebEngine WebEngineWidgets WebKitWidgets)
diff --git a/messageviewer/src/viewerplugins/viewerpluginmanager.cpp b/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
index ebc770d..e6f49fa 100644
--- a/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
+++ b/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
@@ -20,6 +20,7 @@
#include "viewerpluginmanager.h"
#include "viewerplugin.h"
#include "messageviewer_debug.h"
+#include <PimCommon/PluginUtil>
#include <KSharedConfig>
#include <kpluginmetadata.h>
@@ -138,10 +139,8 @@ bool ViewerPluginManagerPrivate::initializePluginList()
pluginData.mEnableByDefault = info.metaData.isEnabledByDefault();
mPluginDataList.append(pluginData);
- const bool pluginEnabledByUser = enabledPlugins.contains(info.metaData.pluginId());
- const bool pluginDisabledByUser = disabledPlugins.contains(info.metaData.pluginId());
- if ((info.metaData.isEnabledByDefault() && !pluginDisabledByUser)
- || (!info.metaData.isEnabledByDefault() && pluginEnabledByUser)) {
+ const bool isPluginActivated = PimCommon::PluginUtil::isPluginActivated(enabledPlugins, disabledPlugins, pluginData.mEnableByDefault, pluginData.mIdentifier);
+ if (isPluginActivated) {
const QString version = info.metaData.version();
if (pluginVersion() == version) {
// only load plugins once, even if found multiple times!