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.
This commit is contained in:
Tobias Doerffel
2014-03-03 23:59:59 +01:00
parent e99efd541a
commit 21b5396253

View File

@@ -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() );