From 21b53962538568027f6c3b47ea02cc9603959dad Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 3 Mar 2014 23:59:59 +0100 Subject: [PATCH] AutomatableModel: load connection settings before automation link Controller connections got lost in case the control had automation patterns attached and thus the loadSettings() function returned prematurely. --- src/core/AutomatableModel.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) 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() );