From cd0810984700afb5c640a7dccb9818a8182f3392 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. (cherry picked from commit 65311ef2b4fbdbdd69447987e8e228afc4964f02) --- include/ControllerConnection.h | 13 ++++++++++++- src/core/ControllerConnection.cpp | 7 +------ src/tracks/InstrumentTrack.cpp | 7 ++++--- 3 files changed, 17 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 0b346fd83..f0cf3327e 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 * @@ -208,12 +209,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 42f84dbae..fa674c644 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -2,7 +2,7 @@ * InstrumentTrack.cpp - implementation of instrument-track-class * (window + data-structures) * - * Copyright (c) 2004-2009 Tobias Doerffel + * Copyright (c) 2004-2010 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -43,6 +43,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" @@ -812,8 +813,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( automationPattern::classNodeName() != - node.nodeName() && + else if( automationPattern::classNodeName() != node.nodeName() && + ControllerConnection::classNodeName() != node.nodeName() && !node.toElement().hasAttribute( "id" ) ) { delete m_instrument;