diff --git a/src/comm/LinkManager.cc b/src/comm/LinkManager.cc index 9e999ced5e6d0a979a9c0eaa5534ea1d3afe210f..dc6c4965204a2b35c056a8c590e70009770f71ae 100644 --- a/src/comm/LinkManager.cc +++ b/src/comm/LinkManager.cc @@ -99,6 +99,16 @@ void LinkManager::setToolbox(QGCToolbox *toolbox) } +// This should only be used by Qml code +void LinkManager::createConnectedLink(LinkConfiguration* config) +{ + for(int i = 0; i < _sharedConfigurations.count(); i++) { + SharedLinkConfigurationPointer& sharedConf = _sharedConfigurations[i]; + if (sharedConf->name() == config->name()) + createConnectedLink(sharedConf); + } +} + LinkInterface* LinkManager::createConnectedLink(SharedLinkConfigurationPointer& config) { if (!config) { diff --git a/src/comm/LinkManager.h b/src/comm/LinkManager.h index f75fc50f149cf3f0d74fcc5a4e0eed8c8e531b7f..9383c38a0e11d727ab5ddca3fbbaf24b9a17eb65 100644 --- a/src/comm/LinkManager.h +++ b/src/comm/LinkManager.h @@ -124,7 +124,10 @@ public: /// Creates, connects (and adds) a link based on the given configuration instance. /// Link takes ownership of config. - Q_INVOKABLE LinkInterface* createConnectedLink(SharedLinkConfigurationPointer& config); + LinkInterface* createConnectedLink(SharedLinkConfigurationPointer& config); + + // This should only be used by Qml code + Q_INVOKABLE void createConnectedLink(LinkConfiguration* config); /// Creates, connects (and adds) a link based on the given configuration name. LinkInterface* createConnectedLink(const QString& name);