From d0e0d9a6320949866b456fc1e1fa329e8b4c246c Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:44:48 -0200 Subject: [PATCH] Update Plugin.cpp --- src/core/Plugin.cpp | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/core/Plugin.cpp b/src/core/Plugin.cpp index 769ed04f2..187be15a3 100644 --- a/src/core/Plugin.cpp +++ b/src/core/Plugin.cpp @@ -37,9 +37,9 @@ #include "MainWindow.h" -static PixmapLoader __dummy_loader; +static PixmapLoader __dummyLoader; -static Plugin::Descriptor dummy_plugin_descriptor = +static Plugin::Descriptor dummyPluginDescriptor = { "dummy", "dummy", @@ -47,21 +47,21 @@ static Plugin::Descriptor dummy_plugin_descriptor = "Tobias Doerffel ", 0x0100, Plugin::Undefined, - &__dummy_loader, + &__dummyLoader, NULL } ; -Plugin::Plugin( const Descriptor * _descriptor, Model * parent ) : +Plugin::Plugin( const Descriptor * descriptor, Model * parent ) : Model( parent ), JournallingObject(), - m_descriptor( _descriptor ) + m_descriptor( descriptor ) { if( m_descriptor == NULL ) { - m_descriptor = &dummy_plugin_descriptor; + m_descriptor = &dummyPluginDescriptor; } } @@ -108,7 +108,7 @@ Plugin * Plugin::instantiate( const QString & pluginName, Model * parent, return new DummyPlugin(); } - InstantiationHook instantiationHook = ( InstantiationHook ) pluginLibrary.resolve( "lmms_plugin_main" ); + InstantiationHook instantiationHook = ( InstantiationHook )pluginLibrary.resolve( "lmms_plugin_main" ); if( instantiationHook == NULL ) { if( Engine::hasGUI() ) @@ -125,13 +125,17 @@ Plugin * Plugin::instantiate( const QString & pluginName, Model * parent, return inst; } -void Plugin::collectErrorForUI( QString err_msg ) + + + +void Plugin::collectErrorForUI( QString errMsg ) { - Engine::mainWindow()->collectError( err_msg ); + Engine::mainWindow()->collectError( errMsg ); } + void Plugin::getDescriptorsOfAvailPlugins( DescriptorList& pluginDescriptors ) { QDir directory( ConfigManager::inst()->pluginDir() ); @@ -188,13 +192,13 @@ PluginView * Plugin::createView( QWidget * parent ) -Plugin::Descriptor::SubPluginFeatures::Key::Key( - const QDomElement & _key ) : + +Plugin::Descriptor::SubPluginFeatures::Key::Key( const QDomElement & key ) : desc( NULL ), - name( _key.attribute( "key" ) ), + name( key.attribute( "key" ) ), attributes() { - QDomNodeList l = _key.elementsByTagName( "attribute" ); + QDomNodeList l = key.elementsByTagName( "attribute" ); for( int i = 0; !l.item( i ).isNull(); ++i ) { QDomElement e = l.item( i ).toElement(); @@ -207,13 +211,13 @@ Plugin::Descriptor::SubPluginFeatures::Key::Key( QDomElement Plugin::Descriptor::SubPluginFeatures::Key::saveXML( - QDomDocument & _doc ) const + QDomDocument & doc ) const { - QDomElement e = _doc.createElement( "key" ); - for( AttributeMap::ConstIterator it = attributes.begin(); - it != attributes.end(); ++it ) + QDomElement e = doc.createElement( "key" ); + for( AttributeMap::ConstIterator it = attributes.begin(); + it != attributes.end(); ++it ) { - QDomElement a = _doc.createElement( "attribute" ); + QDomElement a = doc.createElement( "attribute" ); a.setAttribute( "name", it.key() ); a.setAttribute( "value", it.value() ); e.appendChild( a ); @@ -221,3 +225,5 @@ QDomElement Plugin::Descriptor::SubPluginFeatures::Key::saveXML( return e; } + +