Commit e5473d83 authored by Laurent Montel's avatar Laurent Montel 😁

Return plugin from identifier

parent 4f5a51ef
......@@ -93,6 +93,7 @@ public:
QVector<PluginUtilData> pluginsDataList() const;
QString configGroupName() const;
QString configPrefixSettingKey() const;
GenericPlugin *pluginFromIdentifier(const QString &id);
private:
QVector<PluginUtilData> mPluginDataList;
GenericPluginManager *q;
......@@ -185,6 +186,18 @@ void GenericPluginManagerPrivate::loadPlugin(GenericPluginInfo *item)
}
}
GenericPlugin *GenericPluginManagerPrivate::pluginFromIdentifier(const QString &id)
{
QVector<PimCommon::GenericPlugin *> lst;
QVector<GenericPluginInfo>::ConstIterator end(mPluginList.constEnd());
for (QVector<GenericPluginInfo>::ConstIterator it = mPluginList.constBegin(); it != end; ++it) {
if ((*it).pluginData.mIdentifier == id) {
return (*it).plugin;
}
}
return {};
}
GenericPluginManager::GenericPluginManager(QObject *parent)
: QObject(parent),
d(new GenericPluginManagerPrivate(this))
......@@ -246,3 +259,8 @@ QString GenericPluginManager::configPrefixSettingKey() const
{
return d->configPrefixSettingKey();
}
GenericPlugin *GenericPluginManager::pluginFromIdentifier(const QString &id)
{
return d->pluginFromIdentifier(id);
}
......@@ -64,6 +64,8 @@ public:
QString configGroupName() const;
QString configPrefixSettingKey() const;
GenericPlugin *pluginFromIdentifier(const QString &id);
private:
GenericPluginManagerPrivate *const d;
};
......
Markdown is supported
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