Call plugin init method after plugin configuration loading

This commit is contained in:
Simon Stürz 2018-10-09 13:18:40 +02:00 committed by Michael Zanetti
parent 156ff84888
commit 4a0da12be9
2 changed files with 5 additions and 4 deletions

View File

@ -1117,6 +1117,9 @@ void DeviceManager::loadPlugin(DevicePlugin *pluginIface)
}
}
// Call the init method of the plugin
pluginIface->init();
m_devicePlugins.insert(pluginIface->pluginId(), pluginIface);
connect(pluginIface, &DevicePlugin::emitEvent, this, &DeviceManager::eventTriggered);

View File

@ -285,14 +285,12 @@ QList<ParamType> DevicePlugin::configurationDescription() const
}
/*! This will be called when the DeviceManager initializes the plugin and set up the things behind the scenes.
When implementing a new plugin, use \l{DevicePlugin::init()} instead in order to do initialisation work. */
When implementing a new plugin, use \l{DevicePlugin::init()} instead in order to do initialisation work.
The \l{DevicePlugin::init()} method will be called once the plugin configuration has been loaded. */
void DevicePlugin::initPlugin(DeviceManager *deviceManager)
{
m_deviceManager = deviceManager;
loadMetaData();
init();
}
QPair<bool, QList<ParamType> > DevicePlugin::parseParamTypes(const QJsonArray &array) const