diff --git a/src/core/AutomatableModel.cpp b/src/core/AutomatableModel.cpp index 8a1f15d5e..fecef621c 100644 --- a/src/core/AutomatableModel.cpp +++ b/src/core/AutomatableModel.cpp @@ -144,6 +144,18 @@ void AutomatableModel::loadSettings( const QDomElement& element, const QString& } } + QDomNode connectionNode = element.namedItem( "connection" ); + if( connectionNode.isElement() ) + { + QDomNode thisConnection = node.toElement().namedItem( name ); + if( thisConnection.isElement() ) + { + setControllerConnection( new ControllerConnection( (Controller*)NULL ) ); + m_controllerConnection->loadSettings( thisConnection.toElement() ); + //m_controllerConnection->setTargetName( displayName() ); + } + } + node = element.namedItem( name ); if( node.isElement() ) { @@ -152,18 +164,6 @@ void AutomatableModel::loadSettings( const QDomElement& element, const QString& return; } - node = element.namedItem( "connection" ); - if( node.isElement() ) - { - node = node.namedItem( name ); - if( node.isElement() ) - { - setControllerConnection( new ControllerConnection( (Controller*)NULL ) ); - m_controllerConnection->loadSettings( node.toElement() ); - //m_controllerConnection->setTargetName( displayName() ); - } - } - if( element.hasAttribute( name ) ) { setInitValue( element.attribute( name ).toFloat() );