Better name for "dummy" effects

This commit is contained in:
Tres Finocchiaro
2014-10-23 21:23:13 -04:00
parent b0e12e3897
commit 849dd8a6b3

View File

@@ -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;
}
}
}
}
} ;