From 65311ef2b4fbdbdd69447987e8e228afc4964f02 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 15 Aug 2010 13:56:25 +0200 Subject: [PATCH] InstrumentTrack: do not try to load "libconnection.so" in compat code In compat code of InstrumentTrack::loadTrackSpecificSettings() also check for nodeName being equal to ControllerConnection::classNodeName(). This avoids trying to load the non-existing instrument "connection". In master branch this has been fixed ugly in commit 22c877d4 before, however implement a cleaner solution which is also suitable for backporting. Closes #3021259. --- include/ControllerConnection.h | 13 ++++++++++++- src/core/ControllerConnection.cpp | 7 +------ src/tracks/InstrumentTrack.cpp | 6 +++--- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/include/ControllerConnection.h b/include/ControllerConnection.h index 20c8817b2..440960fca 100644 --- a/include/ControllerConnection.h +++ b/include/ControllerConnection.h @@ -5,6 +5,7 @@ * loading project * * Copyright (c) 2008 Paul Giblock + * Copyright (c) 2010 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -80,7 +81,17 @@ public: virtual void saveSettings( QDomDocument & _doc, QDomElement & _this ); virtual void loadSettings( const QDomElement & _this ); - virtual QString nodeName() const; + + static inline const QString classNodeName() + { + return "connection"; + } + + virtual QString nodeName() const + { + return classNodeName(); + } + public slots: void deleteConnection(); diff --git a/src/core/ControllerConnection.cpp b/src/core/ControllerConnection.cpp index 31c4ee4c5..f6f3b62d3 100644 --- a/src/core/ControllerConnection.cpp +++ b/src/core/ControllerConnection.cpp @@ -3,6 +3,7 @@ * which handles the link between AutomatableModels and controllers * * Copyright (c) 2008 Paul Giblock + * Copyright (c) 2010 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -207,12 +208,6 @@ void ControllerConnection::deleteConnection() delete this; } -QString ControllerConnection::nodeName() const -{ - return( "connection" ); -} - #include "moc_ControllerConnection.cxx" - diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index 6799d7d0d..05ec5b72e 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -47,6 +47,7 @@ #include "automation_pattern.h" #include "bb_track.h" #include "config_mgr.h" +#include "ControllerConnection.h" #include "debug.h" #include "EffectChain.h" #include "EffectRackView.h" @@ -828,9 +829,8 @@ void InstrumentTrack::loadTrackSpecificSettings( const QDomElement & _this ) // 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( node.nodeName() != "connection" && - automationPattern::classNodeName() != - node.nodeName() && + else if( automationPattern::classNodeName() != node.nodeName() && + ControllerConnection::classNodeName() != node.nodeName() && !node.toElement().hasAttribute( "id" ) ) { delete m_instrument;