2121#define QGSPLUGINREGISTRY_H
2222#include < map>
2323class QgsPluginMetadata ;
24+ class QgsPythonUtils ;
2425class QgisPlugin ;
2526class QString ;
2627/* *
@@ -31,29 +32,32 @@ class QString;
3132class QgsPluginRegistry
3233{
3334 public:
34- // ! Returns the instance pointer, creating the object on the first call
35+ // ! Returns the instance pointer, creating the object on the first call
3536 static QgsPluginRegistry* instance ();
36- // ! Return the full path to the plugins library using the plugin name as a key
37+ // ! Return the full path to the plugins library using the plugin name as a key
3738 QString library ( QString pluginKey );
38- // ! Retrieve the metadata for a plugin by name
39+ // ! Retrieve the metadata for a plugin by name
3940 QgsPluginMetadata * pluginMetadata ( QString name );
40- // ! Retrieve a pointer to a loaded plugin by name
41+ // ! Retrieve a pointer to a loaded plugin by name
4142 QgisPlugin * plugin ( QString name );
42- // ! Return whether the plugin is pythonic
43+ // ! Return whether the plugin is pythonic
4344 bool isPythonPlugin ( QString name );
44- // ! Add a plugin to the map of loaded plugins
45+ // ! Add a plugin to the map of loaded plugins
4546 void addPlugin ( QString _library, QString _name, QgisPlugin * _plugin );
46- // ! Add a plugin written in python
47+ // ! Add a plugin written in python
4748 void addPythonPlugin ( QString packageName, QString pluginName );
48- // ! Remove a plugin from the list of loaded plugins
49+ // ! Remove a plugin from the list of loaded plugins
4950 void removePlugin ( QString name );
50- // ! Unload plugins
51+ // ! Unload plugins
5152 void unloadAll ();
53+ // ! Save pointer for python utils (needed for unloading python plugins)
54+ void setPythonUtils (QgsPythonUtils* pythonUtils);
5255 protected:
53- // ! protected constructor
56+ // ! protected constructor
5457 QgsPluginRegistry ();
5558 private:
5659 static QgsPluginRegistry* _instance;
5760 std::map<QString, QgsPluginMetadata*> plugins;
61+ QgsPythonUtils* mPythonUtils ;
5862};
5963#endif // QgsPluginRegistry_H
0 commit comments