From 38799f80afd7322cd84bd259fcf4f88396cf9e20 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:46:02 -0200 Subject: [PATCH] Update Plugin.h --- include/Plugin.h | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/include/Plugin.h b/include/Plugin.h index b73238ab5..5efcf68b7 100644 --- a/include/Plugin.h +++ b/include/Plugin.h @@ -85,19 +85,19 @@ public: { typedef QMap AttributeMap; - inline Key( const Plugin::Descriptor * _desc = NULL, - const QString & _name = QString(), - const AttributeMap & _am = AttributeMap() ) + inline Key( const Plugin::Descriptor * desc = NULL, + const QString & name = QString(), + const AttributeMap & am = AttributeMap() ) : - desc( _desc ), - name( _name ), - attributes( _am ) + desc( desc ), + name( name ), + attributes( am ) { } - Key( const QDomElement & _key ); + Key( const QDomElement & key ); - QDomElement saveXML( QDomDocument & _doc ) const; + QDomElement saveXML( QDomDocument & doc ) const; inline bool isValid() const { @@ -142,13 +142,15 @@ public: typedef QList DescriptorList; // contructor of a plugin - Plugin( const Descriptor* descriptor, Model* parent ); + Plugin( const Descriptor * descriptor, Model * parent ); virtual ~Plugin(); // returns display-name out of descriptor virtual QString displayName() const { - return Model::displayName().isEmpty() ? m_descriptor->displayName : Model::displayName(); + return Model::displayName().isEmpty() + ? m_descriptor->displayName + : Model::displayName(); } // return plugin-type @@ -158,41 +160,41 @@ public: } // return plugin-descriptor for further information - inline const Descriptor* descriptor() const + inline const Descriptor * descriptor() const { return m_descriptor; } // can be called if a file matching supportedFileTypes should be // loaded/processed with the help of this plugin - virtual void loadFile( const QString& file ); + virtual void loadFile( const QString & file ); // Called if external source needs to change something but we cannot // reference the class header. Should return null if not key not found. - virtual AutomatableModel* childModel( const QString& modelName ); + virtual AutomatableModel* childModel( const QString & modelName ); // returns an instance of a plugin whose name matches to given one // if specified plugin couldn't be loaded, it creates a dummy-plugin static Plugin * instantiate( const QString& pluginName, Model * parent, void * data ); // fills given list with descriptors of all available plugins - static void getDescriptorsOfAvailPlugins( DescriptorList& pluginDescriptors ); + static void getDescriptorsOfAvailPlugins( DescriptorList & pluginDescriptors ); // create a view for the model - PluginView * createView( QWidget* parent ); + PluginView * createView( QWidget * parent ); protected: // create a view for the model - virtual PluginView* instantiateView( QWidget* ) = 0; - void collectErrorForUI( QString err_msg ); + virtual PluginView* instantiateView( QWidget * ) = 0; + void collectErrorForUI( QString errMsg ); private: - const Descriptor* m_descriptor; + const Descriptor * m_descriptor; // pointer to instantiation-function in plugin - typedef Plugin * ( * InstantiationHook )( Model*, void* ); + typedef Plugin * ( * InstantiationHook )( Model * , void * ); } ;