summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-06 20:16:52 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-06 20:17:11 (GMT)
commitf9726198c0406d1afa51e18bee3bce5200fe5f77 (patch)
treef7a64e167f9656e39891d981d417c6f9a4de95f7
parentff988d86926bc68dc80c0c938a7206244f7cbeb3 (diff)
get description from json file directly
-rw-r--r--CMakeLists.txt2
-rw-r--r--messagecomposer/src/plugineditor/plugineditormanager.cpp24
-rw-r--r--messagecomposer/src/plugineditor/plugineditormanager.h15
-rw-r--r--messageviewer/src/viewerplugins/viewerpluginmanager.cpp2
4 files changed, 41 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fc9669d..82b851d 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.48")
+set(PIM_VERSION "5.3.49")
set(MESSAGELIB_LIB_VERSION ${PIM_VERSION})
set(AKONADIMIME_LIB_VERSION "5.3.40")
diff --git a/messagecomposer/src/plugineditor/plugineditormanager.cpp b/messagecomposer/src/plugineditor/plugineditormanager.cpp
index 9638ef5..67738d6 100644
--- a/messagecomposer/src/plugineditor/plugineditormanager.cpp
+++ b/messagecomposer/src/plugineditor/plugineditormanager.cpp
@@ -79,8 +79,12 @@ public:
}
void loadPlugin(PluginEditorInfo *item);
QVector<PluginEditor *> pluginsList() const;
+ QVector<MessageComposer::PluginEditorManager::PluginEditorData> pluginDataList() const;
bool initializePlugins();
+
+private:
QVector<PluginEditorInfo> mPluginList;
+ QVector<MessageComposer::PluginEditorManager::PluginEditorData> mPluginDataList;
PluginEditorManager *q;
};
@@ -96,7 +100,15 @@ bool PluginEditorManagerPrivate::initializePlugins()
while (i.hasPrevious()) {
PluginEditorInfo info;
info.metaData = i.previous();
- if (info.metaData.isEnabledByDefault()) {
+
+ //Store plugin info
+ MessageComposer::PluginEditorManager::PluginEditorData pluginData;
+ pluginData.mDescription = info.metaData.description();
+ pluginData.mName = info.metaData.name();
+ pluginData.mEnableByDefault = info.metaData.isEnabledByDefault();
+ mPluginDataList.append(pluginData);
+
+ if (pluginData.mEnableByDefault) {
const QVariant p = info.metaData.rawData().value(QStringLiteral("X-KDE-KMailEditor-Order")).toVariant();
int order = -1;
if (p.isValid()) {
@@ -144,6 +156,11 @@ QVector<PluginEditor *> PluginEditorManagerPrivate::pluginsList() const
return lst;
}
+QVector<MessageComposer::PluginEditorManager::PluginEditorData> PluginEditorManagerPrivate::pluginDataList() const
+{
+ return mPluginDataList;
+}
+
PluginEditorManager::PluginEditorManager(QObject *parent)
: QObject(parent),
d(new MessageComposer::PluginEditorManagerPrivate(this))
@@ -169,3 +186,8 @@ QVector<PluginEditor *> PluginEditorManager::pluginsList() const
{
return d->pluginsList();
}
+
+QVector<MessageComposer::PluginEditorManager::PluginEditorData> PluginEditorManager::pluginsDataList() const
+{
+ return d->pluginDataList();
+}
diff --git a/messagecomposer/src/plugineditor/plugineditormanager.h b/messagecomposer/src/plugineditor/plugineditormanager.h
index 081dce4..820d57a 100644
--- a/messagecomposer/src/plugineditor/plugineditormanager.h
+++ b/messagecomposer/src/plugineditor/plugineditormanager.h
@@ -30,6 +30,19 @@ class MESSAGECOMPOSER_EXPORT PluginEditorManager : public QObject
{
Q_OBJECT
public:
+ class PluginEditorData
+ {
+ public:
+ PluginEditorData()
+ : mEnableByDefault(false)
+ {
+
+ }
+ QString mDescription;
+ QString mName;
+ bool mEnableByDefault;
+ };
+
explicit PluginEditorManager(QObject *parent = Q_NULLPTR);
~PluginEditorManager();
@@ -37,6 +50,8 @@ public:
QVector<PluginEditor *> pluginsList() const;
+ QVector<PluginEditorManager::PluginEditorData> pluginsDataList() const;
+
private:
PluginEditorManagerPrivate *const d;
};
diff --git a/messageviewer/src/viewerplugins/viewerpluginmanager.cpp b/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
index d155099..6e81df9 100644
--- a/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
+++ b/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
@@ -80,8 +80,10 @@ public:
void loadPlugin(ViewerPluginInfo *item);
QVector<MessageViewer::ViewerPlugin *> pluginsList() const;
QVector<ViewerPluginInfo> mPluginList;
+
QString serviceTypeName;
QString pluginName;
+private:
ViewerPluginManager *q;
};