Commit f9726198 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

get description from json file directly

parent ff988d86
......@@ -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")
......
......@@ -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();
}
......@@ -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;
};
......
......@@ -80,8 +80,10 @@ public:
void loadPlugin(ViewerPluginInfo *item);
QVector<MessageViewer::ViewerPlugin *> pluginsList() const;
QVector<ViewerPluginInfo> mPluginList;
QString serviceTypeName;
QString pluginName;
private:
ViewerPluginManager *q;
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment