From 849dd8a6b30a00f45a442412adcc4a28e1760cc5 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Thu, 23 Oct 2014 21:23:13 -0400 Subject: [PATCH] Better name for "dummy" effects --- include/DummyEffect.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/include/DummyEffect.h b/include/DummyEffect.h index 30d267cce..6c2f31a26 100644 --- a/include/DummyEffect.h +++ b/include/DummyEffect.h @@ -87,6 +87,7 @@ public: m_controls( this ), m_originalPluginData( originalPluginData ) { + setName(); } virtual ~DummyEffect() @@ -113,7 +114,28 @@ public: private: DummyEffectControls m_controls; const QDomElement m_originalPluginData; + + // Parse the display name from the dom + virtual void setName() + { + QDomNodeList keys = originalPluginData().elementsByTagName( "key" ); + for( int i = 0; !keys.item( i ).isNull(); ++i ) + { + QDomNodeList attributes = keys.item( i ).toElement().elementsByTagName( "attribute" ); + for( int j = 0; !attributes.item( j ).isNull(); ++j ) + { + QDomElement attribute = attributes.item( j ).toElement(); + if( attribute.hasAttribute( "value" ) ) + { + QString name = tr("NOT FOUND") + " (" + attribute.attribute( "value" ) + ")"; + setDisplayName(name); + return; + } + } + + } + } } ;