summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-07 06:11:20 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-07 06:11:20 (GMT)
commit3ffb32a5a0b6eb1290508b390c4cea8fd3ed65b5 (patch)
treee33cb9630b7823abf1e3c073a4abaedda3a7f70b
parent3de6dfae970653a0dac5711aa7565bd210145554 (diff)
Add ViewerPluginData
-rw-r--r--CMakeLists.txt2
-rw-r--r--messageviewer/src/viewerplugins/viewerpluginmanager.cpp21
-rw-r--r--messageviewer/src/viewerplugins/viewerpluginmanager.h14
3 files changed, 35 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 82b851d..a817f6f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,7 +18,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
-set(PIM_VERSION "5.3.49")
+set(PIM_VERSION "5.3.50")
set(MESSAGELIB_LIB_VERSION ${PIM_VERSION})
set(AKONADIMIME_LIB_VERSION "5.3.40")
diff --git a/messageviewer/src/viewerplugins/viewerpluginmanager.cpp b/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
index ccc34f7..3ed9155 100644
--- a/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
+++ b/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
@@ -79,11 +79,13 @@ public:
bool initializePluginList();
void loadPlugin(ViewerPluginInfo *item);
QVector<MessageViewer::ViewerPlugin *> pluginsList() const;
- QVector<ViewerPluginInfo> mPluginList;
+ QVector<MessageViewer::ViewerPluginManager::ViewerPluginData> pluginDataList() const;
QString serviceTypeName;
QString pluginName;
private:
+ QVector<ViewerPluginInfo> mPluginList;
+ QVector<MessageViewer::ViewerPluginManager::ViewerPluginData> mPluginDataList;
ViewerPluginManager *q;
};
@@ -129,6 +131,12 @@ bool ViewerPluginManagerPrivate::initializePluginList()
while (i.hasPrevious()) {
ViewerPluginInfo info;
info.metaData = i.previous();
+ MessageViewer::ViewerPluginManager::ViewerPluginData pluginData;
+ pluginData.mDescription = info.metaData.description();
+ pluginData.mName = info.metaData.name();
+ pluginData.mEnableByDefault = info.metaData.isEnabledByDefault();
+ mPluginDataList.append(pluginData);
+
const bool pluginEnabledByUser = enabledPlugins.contains(info.metaData.name());
const bool pluginDisabledByUser = disabledPlugins.contains(info.metaData.name());
if ((info.metaData.isEnabledByDefault() && !pluginDisabledByUser)
@@ -174,6 +182,12 @@ QVector<ViewerPlugin *> ViewerPluginManagerPrivate::pluginsList() const
return lst;
}
+QVector<MessageViewer::ViewerPluginManager::ViewerPluginData> ViewerPluginManagerPrivate::pluginDataList() const
+{
+ return mPluginDataList;
+}
+
+
ViewerPluginManager::ViewerPluginManager(QObject *parent)
: QObject(parent),
d(new MessageViewer::ViewerPluginManagerPrivate(this))
@@ -219,3 +233,8 @@ QString ViewerPluginManager::pluginName() const
{
return d->pluginName;
}
+
+QVector<MessageViewer::ViewerPluginManager::ViewerPluginData> ViewerPluginManager::pluginsDataList() const
+{
+ return d->pluginDataList();
+}
diff --git a/messageviewer/src/viewerplugins/viewerpluginmanager.h b/messageviewer/src/viewerplugins/viewerpluginmanager.h
index 2047d3e..78876ea 100644
--- a/messageviewer/src/viewerplugins/viewerpluginmanager.h
+++ b/messageviewer/src/viewerplugins/viewerpluginmanager.h
@@ -31,11 +31,25 @@ class MESSAGEVIEWER_EXPORT ViewerPluginManager : public QObject
{
Q_OBJECT
public:
+ class ViewerPluginData
+ {
+ public:
+ ViewerPluginData()
+ : mEnableByDefault(false)
+ {
+
+ }
+ QString mDescription;
+ QString mName;
+ bool mEnableByDefault;
+ };
+
explicit ViewerPluginManager(QObject *parent = Q_NULLPTR);
~ViewerPluginManager();
static ViewerPluginManager *self();
QVector<MessageViewer::ViewerPlugin *> pluginsList() const;
+ QVector<MessageViewer::ViewerPluginManager::ViewerPluginData> pluginsDataList() const;
void setServiceTypeName(const QString &serviceName);
QString serviceTypeName() const;