From 4a0da12be919cb1157d3dda88c9b704c2291d75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Tue, 9 Oct 2018 13:18:40 +0200 Subject: [PATCH] Call plugin init method after plugin configuration loading --- libnymea/devicemanager.cpp | 3 +++ libnymea/plugin/deviceplugin.cpp | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libnymea/devicemanager.cpp b/libnymea/devicemanager.cpp index 5a9f88cf..017780e8 100644 --- a/libnymea/devicemanager.cpp +++ b/libnymea/devicemanager.cpp @@ -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); diff --git a/libnymea/plugin/deviceplugin.cpp b/libnymea/plugin/deviceplugin.cpp index e72c3fa1..f6752908 100644 --- a/libnymea/plugin/deviceplugin.cpp +++ b/libnymea/plugin/deviceplugin.cpp @@ -285,14 +285,12 @@ QList 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 > DevicePlugin::parseParamTypes(const QJsonArray &array) const