InstrumentTrack: partly revert ad27039b9b

Even though there are probably not many old projects out there, at least
old presets didn't load properly anymore as of ad27039b9b.
Fix this by reintroducing compat code.
This commit is contained in:
Tobias Doerffel
2014-01-26 23:18:59 +01:00
parent db0570b130
commit ef4f9b1b60

View File

@@ -767,6 +767,22 @@ void InstrumentTrack::loadTrackSpecificSettings( const QDomElement & thisElement
emit instrumentChanged();
}
// compat code - if node-name doesn't match any known
// one, we assume that it is an instrument-plugin
// which we'll try to load
else if( AutomationPattern::classNodeName() != node.nodeName() &&
ControllerConnection::classNodeName() != node.nodeName() &&
!node.toElement().hasAttribute( "id" ) )
{
delete m_instrument;
m_instrument = NULL;
m_instrument = Instrument::instantiate( node.nodeName(), this );
if( m_instrument->nodeName() == node.nodeName() )
{
m_instrument->restoreState( node.toElement() );
}
emit instrumentChanged();
}
}
node = node.nextSibling();
}