Skip to content

Commit 4ff166a

Browse files
author
wonder
committedOct 23, 2008
- QgsPluginRegistry - metadata stored in QMap
- address plugins by their unique name: - library's basename for c++ plugins - module name for python plugins (before plugins were addressed by their name, causing ambiguity) - general cleanups in plugin handling git-svn-id: http://svn.osgeo.org/qgis/trunk@9526 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 85122d1 commit 4ff166a

File tree

7 files changed

+146
-111
lines changed

7 files changed

+146
-111
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
#include "qgspastetransformations.h"
120120
#include "qgspluginitem.h"
121121
#include "qgspluginmanager.h"
122+
#include "qgspluginmetadata.h"
122123
#include "qgspluginregistry.h"
123124
#include "qgspoint.h"
124125
#include "qgsproject.h"
@@ -1846,7 +1847,7 @@ void QgisApp::restoreSessionPlugins( QString thePluginDirString )
18461847
{
18471848
QString myFullPath = thePluginDirString + "/" + myPluginDir[i];
18481849

1849-
1850+
QString baseName = QFileInfo(myFullPath).baseName();
18501851
QLibrary *myLib = new QLibrary( myFullPath );
18511852
bool loaded = myLib->load();
18521853
if ( loaded )
@@ -1858,15 +1859,15 @@ void QgisApp::restoreSessionPlugins( QString thePluginDirString )
18581859
if ( myName && myDescription && myVersion )
18591860
{
18601861
//check if the plugin was active on last session
1861-
QString myEntryName = myName();
1862+
18621863
// Windows stores a "true" value as a 1 in the registry so we
18631864
// have to use readBoolEntry in this function
18641865

1865-
if ( mySettings.value( "/Plugins/" + myEntryName ).toBool() )
1866+
if ( mySettings.value( "/Plugins/" + baseName ).toBool() )
18661867
{
18671868
//QgsDebugMsg("Loading plugin: " + myEntryName);
18681869

1869-
loadPlugin( myName(), myDescription(), myFullPath );
1870+
loadPlugin( myFullPath, myName() );
18701871
}
18711872
else
18721873
{
@@ -4142,7 +4143,7 @@ void QgisApp::showPluginManager()
41424143
}
41434144
else
41444145
{
4145-
loadPlugin( plugin.name(), plugin.description(), plugin.fullPath() );
4146+
loadPlugin( plugin.fullPath(), plugin.name() );
41464147
}
41474148
it++;
41484149
}
@@ -4209,17 +4210,17 @@ void QgisApp::loadPythonPlugin( QString packageName, QString pluginName )
42094210

42104211

42114212
QgsPluginRegistry *pRegistry = QgsPluginRegistry::instance();
4212-
4213+
42134214
// is loaded already?
4214-
if ( pRegistry->library( pluginName ).isEmpty() )
4215+
if ( ! pRegistry->isLoaded(packageName) )
42154216
{
42164217
mPythonUtils->loadPlugin( packageName );
42174218
mPythonUtils->startPlugin( packageName );
42184219

42194220
// TODO: test success
42204221

42214222
// add to plugin registry
4222-
pRegistry->addPythonPlugin( packageName, pluginName );
4223+
pRegistry->addPlugin( packageName, QgsPluginMetadata( packageName, pluginName, NULL, true) );
42234224

42244225
// add to settings
42254226
QSettings settings;
@@ -4230,13 +4231,15 @@ void QgisApp::loadPythonPlugin( QString packageName, QString pluginName )
42304231
}
42314232
}
42324233

4233-
void QgisApp::loadPlugin( QString name, QString description, QString theFullPathName )
4234+
void QgisApp::loadPlugin( QString theFullPathName, QString name )
42344235
{
42354236
QSettings settings;
42364237
// first check to see if its already loaded
42374238
QgsPluginRegistry *pRegistry = QgsPluginRegistry::instance();
4238-
QString lib = pRegistry->library( name );
4239-
if ( lib.length() > 0 )
4239+
4240+
QString baseName = QFileInfo(theFullPathName).baseName();
4241+
4242+
if ( pRegistry->isLoaded(baseName) )
42404243
{
42414244
// plugin is loaded
42424245
// QMessageBox::warning(this, "Already Loaded", description + " is already loaded");
@@ -4269,9 +4272,9 @@ void QgisApp::loadPlugin( QString name, QString description, QString theFullPath
42694272
{
42704273
pl->initGui();
42714274
// add it to the plugin registry
4272-
pRegistry->addPlugin( myLib->fileName(), name, pl );
4275+
pRegistry->addPlugin(baseName, QgsPluginMetadata(myLib->fileName(), name, pl) );
42734276
//add it to the qsettings file [ts]
4274-
settings.setValue( "/Plugins/" + name, true );
4277+
settings.setValue( "/Plugins/" + baseName, true );
42754278
}
42764279
else
42774280
{
@@ -4280,7 +4283,7 @@ void QgisApp::loadPlugin( QString name, QString description, QString theFullPath
42804283
"The following diagnostic information may help the QGIS developers resolve the issue:\n%1." ).arg
42814284
( myError ) );
42824285
//disable it to the qsettings file [ts]
4283-
settings.setValue( "/Plugins/" + name, false );
4286+
settings.setValue( "/Plugins/" + baseName, false );
42844287
}
42854288
}
42864289
else
@@ -4290,6 +4293,8 @@ void QgisApp::loadPlugin( QString name, QString description, QString theFullPath
42904293

42914294
}
42924295
break;
4296+
/*
4297+
// TODO: to be removed completely
42934298
case QgisPlugin::MAPLAYER:
42944299
{
42954300
// Map layer - requires interaction with the canvas
@@ -4320,6 +4325,7 @@ void QgisApp::loadPlugin( QString name, QString description, QString theFullPath
43204325
}
43214326
}
43224327
break;
4328+
*/
43234329
default:
43244330
// type is unknown
43254331
QgsDebugMsg( "Plugin " + theFullPathName + " did not return a valid type and cannot be loaded" );

‎src/app/qgisapp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ class QgisApp : public QMainWindow
385385
//! load python support if possible
386386
void loadPythonSupport();
387387
//! plugin loader
388-
void loadPlugin( QString name, QString description, QString mFullPath );
388+
void loadPlugin( QString mFullPath, QString name );
389389
//! python plugin loader
390390
void loadPythonPlugin( QString packageName, QString pluginName );
391391
//! Find the QMenu with the given name (ie the user visible text on the menu item)

‎src/app/qgspluginitem.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
/* $Id$ */
1818
#include "qgspluginitem.h"
1919

20-
QgsPluginItem::QgsPluginItem( QString _name, QString _description, QString _fullPath, QString _type, bool _python ):
21-
m_name( _name ), m_description( _description ), m_fullPath( _fullPath ), m_type( _type ), m_python( _python )
20+
QgsPluginItem::QgsPluginItem( QString _name, QString _fullPath, QString _type, bool _python ):
21+
m_name( _name ), m_fullPath( _fullPath ), m_type( _type ), m_python( _python )
2222
{
2323

2424
}

‎src/app/qgspluginitem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Class to contain information about a loadable plugin, including its name, descri
2626
class QgsPluginItem
2727
{
2828
public:
29-
QgsPluginItem( QString name = 0, QString description = 0, QString fullPath = 0, QString type = 0, bool python = false );
29+
QgsPluginItem( QString name = 0, QString fullPath = 0, QString type = 0, bool python = false );
3030
QString name();
3131
QString description();
3232
QString fullPath();

‎src/app/qgspluginmanager.cpp

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
const int PLUGIN_DATA_ROLE = Qt::UserRole;
5757
const int PLUGIN_LIBRARY_ROLE = Qt::UserRole + 1;
58-
const int PLUGIN_LIBRARY_NAME_ROLE = Qt::UserRole + 2;
58+
const int PLUGIN_BASE_NAME_ROLE = Qt::UserRole + 2;
5959

6060
QgsPluginManager::QgsPluginManager( QgsPythonUtils* pythonUtils, QWidget * parent, Qt::WFlags fl )
6161
: QDialog( parent, fl )
@@ -151,9 +151,9 @@ void QgsPluginManager::getPythonPluginDescriptions()
151151
// filtering will be done on the display role so give it name and desription
152152
// user wont see this text since we are using a custome delegate
153153
QStandardItem * mypDetailItem = new QStandardItem( pluginName + " - " + description );
154-
QString myLibraryName = "python:" + packageName;;
154+
QString myLibraryName = "python:" + packageName;
155155
mypDetailItem->setData( myLibraryName, PLUGIN_LIBRARY_ROLE ); //for loading libs later
156-
mypDetailItem->setData( pluginName, PLUGIN_LIBRARY_NAME_ROLE ); //for matching in registry later
156+
mypDetailItem->setData( packageName, PLUGIN_BASE_NAME_ROLE ); //for matching in registry later
157157
mypDetailItem->setCheckable( false );
158158
mypDetailItem->setEditable( false );
159159
// setData in the delegate with a variantised QgsDetailedItemData
@@ -167,19 +167,15 @@ void QgsPluginManager::getPythonPluginDescriptions()
167167

168168
// check to see if the plugin is loaded and set the checkbox accordingly
169169
QgsPluginRegistry *pRegistry = QgsPluginRegistry::instance();
170-
QString libName = pRegistry->library( pluginName );
171-
if ( libName.length() == 0 || !pRegistry->isPythonPlugin( pluginName ) )
170+
if ( pRegistry->isLoaded(packageName) && pRegistry->isPythonPlugin(packageName) )
172171
{
173-
QgsDebugMsg( "Couldn't find library name in the registry" );
172+
QgsDebugMsg( "Found plugin in the registry" );
173+
// set the checkbox
174+
myData.setChecked( true );
174175
}
175176
else
176177
{
177-
QgsDebugMsg( "Found library name in the registry" );
178-
if ( libName == packageName )
179-
{
180-
// set the checkbox
181-
myData.setChecked( true );
182-
}
178+
QgsDebugMsg( "Couldn't find plugin in the registry: " + packageName );
183179
}
184180
QVariant myVariant = qVariantFromValue( myData );
185181
mypDetailItem->setData( myVariant, PLUGIN_DATA_ROLE );
@@ -297,40 +293,40 @@ void QgsPluginManager::getPluginDescriptions()
297293
delete myLib;
298294
continue;
299295
}
296+
297+
QString pluginName = pName();
298+
QString pluginDesc = pDesc();
299+
QString pluginVersion = pVersion();
300+
QString baseName = QFileInfo(lib).baseName();
300301

301302
QString myLibraryName = pluginDir[i];
302303
// filtering will be done on the display role so give it name and desription
303304
// user wont see this text since we are using a custome delegate
304-
QStandardItem * mypDetailItem = new QStandardItem( pName() + " - " + pDesc() );
305+
QStandardItem * mypDetailItem = new QStandardItem( pluginName + " - " + pluginDesc );
305306
mypDetailItem->setData( myLibraryName, PLUGIN_LIBRARY_ROLE );
306-
mypDetailItem->setData( pName(), PLUGIN_LIBRARY_NAME_ROLE ); //for matching in registry later
307+
mypDetailItem->setData( baseName, PLUGIN_BASE_NAME_ROLE ); //for matching in registry later
307308
QgsDetailedItemData myData;
308-
myData.setTitle( pName() );
309-
myData.setDetail( pDesc() );
309+
myData.setTitle( pluginName );
310+
myData.setDetail( pluginDesc );
310311
myData.setRenderAsWidget( false );
311312
myData.setCheckable( true );
312313
myData.setChecked( false ); //start unchecked - we will check it later if needed
313314

314-
//round trip test - delete this...no need to uncomment
315-
//QgsDetailedItemData myData2 = qVariantValue<QgsDetailedItemData>(myVariant);
316-
//Q_ASSERT(myData.title() == myData2.title());
317-
//round trip test ends
318-
319315
QgsDebugMsg( "Getting an instance of the QgsPluginRegistry" );
320316

321317
// check to see if the plugin is loaded and set the checkbox accordingly
322318
QgsPluginRegistry *pRegistry = QgsPluginRegistry::instance();
323-
QString libName = pRegistry->library( pName() );
324319

325320
// get the library using the plugin description
326-
if ( libName.length() == 0 )
321+
if ( !pRegistry->isLoaded(baseName) )
327322
{
328-
QgsDebugMsg( "Couldn't find library name in the registry" );
323+
QgsDebugMsg( "Couldn't find plugin in the registry" );
329324
}
330325
else
331326
{
332-
QgsDebugMsg( "Found library name in the registry" );
333-
if ( libName == myLib->fileName() )
327+
QgsDebugMsg( "Found plugin in the registry" );
328+
// TODO: this check shouldn't be necessary, plugin base names must be unique
329+
if ( pRegistry->library(baseName) == myLib->fileName() )
334330
{
335331
// set the checkbox
336332
myData.setChecked( true );
@@ -367,32 +363,36 @@ void QgsPluginManager::unload()
367363
myIndex = mModelPlugins->index( row, 0 );
368364
// its off -- see if it is loaded and if so, unload it
369365
QgsPluginRegistry *pRegistry = QgsPluginRegistry::instance();
370-
QgsDebugMsg( QString( "Checking to see if %1 is loaded" ).arg( mModelPlugins->data( myIndex, PLUGIN_LIBRARY_NAME_ROLE ).toString() ) );
371-
QString pluginName = mModelPlugins->data( myIndex, PLUGIN_LIBRARY_NAME_ROLE ).toString();
372-
if ( pRegistry->isPythonPlugin( pluginName ) )
366+
367+
// is loaded?
368+
QString baseName = mModelPlugins->data( myIndex, PLUGIN_BASE_NAME_ROLE ).toString();
369+
if ( ! pRegistry->isLoaded( baseName ) )
370+
continue;
371+
372+
if ( pRegistry->isPythonPlugin( baseName ) )
373373
{
374374
if ( mPythonUtils && mPythonUtils->isEnabled() )
375375
{
376-
QString packageName = pRegistry->library( pluginName );
377-
mPythonUtils->unloadPlugin( packageName );
376+
mPythonUtils->unloadPlugin( baseName );
378377
//disable it to the qsettings file
379-
settings.setValue( "/PythonPlugins/" + packageName, false );
378+
settings.setValue( "/PythonPlugins/" + baseName, false );
380379
}
381380
}
382381
else // C++ plugin
383382
{
384-
QgisPlugin *plugin = pRegistry->plugin( pluginName );
383+
QgisPlugin *plugin = pRegistry->plugin( baseName );
385384
if ( plugin )
386385
{
387386
plugin->unload();
388387
}
389388
//disable it to the qsettings file [ts]
390-
settings.setValue( "/Plugins/" + pluginName, false );
389+
settings.setValue( "/Plugins/" + baseName, false );
391390
}
392391
// remove the plugin from the registry
393-
pRegistry->removePlugin( pluginName );
392+
pRegistry->removePlugin( baseName );
394393
}
395394
}
395+
QgsPluginRegistry::instance()->dump();
396396
}
397397

398398
std::vector < QgsPluginItem > QgsPluginManager::getSelectedPlugins()
@@ -406,7 +406,8 @@ std::vector < QgsPluginItem > QgsPluginManager::getSelectedPlugins()
406406

407407
if ( myData.isChecked() )
408408
{
409-
QString pluginName = mModelPlugins->item( row, 0 )->data( PLUGIN_LIBRARY_NAME_ROLE ).toString();
409+
//QString baseName = mModelPlugins->item( row, 0 )->data( PLUGIN_BASE_NAME_ROLE ).toString();
410+
QString pluginName = mModelPlugins->item( row, 0 )->data( Qt::DisplayRole ).toString();
410411
bool pythonic = false;
411412

412413
QString library = mModelPlugins->item( row, 0 )->data( PLUGIN_LIBRARY_ROLE ).toString();
@@ -425,9 +426,7 @@ std::vector < QgsPluginItem > QgsPluginManager::getSelectedPlugins()
425426
// QString fullPath=0,
426427
// QString type=0,
427428
// bool python=false);
428-
pis.push_back( QgsPluginItem( pluginName,
429-
mModelPlugins->item( row, 0 )->data( Qt::DisplayRole ).toString(), //display role
430-
library, 0, pythonic ) );
429+
pis.push_back( QgsPluginItem( pluginName, library, 0, pythonic ) );
431430
}
432431

433432
}
@@ -472,9 +471,10 @@ void QgsPluginManager::on_vwPlugins_clicked( const QModelIndex &theIndex )
472471
// the index row in the underlying model so we need to jump through this
473472
// little hoop to get the correct item
474473
//
475-
QStandardItem * mypItem =
476-
mModelPlugins->findItems( theIndex.data( Qt ::DisplayRole ).toString() ).first();
477-
QgsDetailedItemData myData =
474+
475+
QModelIndex realIndex = mModelProxy->mapToSource(theIndex);
476+
QStandardItem* mypItem = mModelPlugins->itemFromIndex(realIndex);
477+
QgsDetailedItemData myData =
478478
qVariantValue<QgsDetailedItemData>( mypItem->data( PLUGIN_DATA_ROLE ) );
479479
if ( myData.isChecked() )
480480
{

‎src/app/qgspluginregistry.cpp

Lines changed: 49 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -44,77 +44,88 @@ void QgsPluginRegistry::setPythonUtils( QgsPythonUtils* pythonUtils )
4444
mPythonUtils = pythonUtils;
4545
}
4646

47-
QString QgsPluginRegistry::library( QString pluginKey )
47+
bool QgsPluginRegistry::isLoaded( QString key )
4848
{
49-
QgsPluginMetadata *pmd = plugins[pluginKey];
50-
QString retval;
51-
if ( pmd )
52-
{
53-
retval = pmd->library();
54-
}
55-
return retval;
49+
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find(key);
50+
return (it != mPlugins.end());
5651
}
5752

58-
QgsPluginMetadata *QgsPluginRegistry::pluginMetadata( QString name )
53+
QString QgsPluginRegistry::library( QString key )
5954
{
60-
return plugins[name];
55+
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find(key);
56+
if (it == mPlugins.end())
57+
return QString();
58+
59+
return it->library();
6160
}
6261

63-
QgisPlugin *QgsPluginRegistry::plugin( QString name )
62+
QgisPlugin *QgsPluginRegistry::plugin( QString key )
6463
{
65-
QgsPluginMetadata *pmd = plugins[name];
66-
QgisPlugin *retval = 0;
67-
if ( pmd )
68-
{
69-
retval = pmd->plugin();
70-
}
71-
return retval;
64+
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find(key);
65+
if (it == mPlugins.end())
66+
return NULL;
67+
68+
return it->plugin();
7269
}
7370

74-
bool QgsPluginRegistry::isPythonPlugin( QString name )
71+
bool QgsPluginRegistry::isPythonPlugin( QString key )
7572
{
76-
QgsPluginMetadata* pmd = plugins[name];
77-
if ( pmd )
78-
return pmd->isPython();
79-
else
73+
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find(key);
74+
if (it == mPlugins.end())
8075
return false;
76+
return it->isPython();
8177
}
8278

83-
void QgsPluginRegistry::addPlugin( QString library, QString name, QgisPlugin * plugin )
79+
void QgsPluginRegistry::addPlugin( QString key, QgsPluginMetadata metadata )
8480
{
85-
plugins[name] = new QgsPluginMetadata( library, name, plugin );
81+
mPlugins.insert(key, metadata);
8682
}
8783

88-
89-
void QgsPluginRegistry::addPythonPlugin( QString packageName, QString pluginName )
84+
void QgsPluginRegistry::dump()
9085
{
91-
plugins[pluginName] = new QgsPluginMetadata( packageName, pluginName, NULL, true ); // true == python plugin
86+
QgsDebugMsg("PLUGINS IN REGISTRY: key -> (name, library, isPython)");
87+
for ( QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.begin();
88+
it != mPlugins.end();
89+
it++ )
90+
{
91+
QgsDebugMsg(QString("PLUGIN: %1 -> (%2, %3, %4)")
92+
.arg(it.key())
93+
.arg(it->name())
94+
.arg(it->library())
95+
.arg(it->isPython()));
96+
}
9297
}
9398

94-
void QgsPluginRegistry::removePlugin( QString name )
99+
100+
void QgsPluginRegistry::removePlugin( QString key )
95101
{
96-
plugins.erase( name );
102+
QgsDebugMsg("removing plugin: "+key);
103+
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find(key);
104+
if (it != mPlugins.end())
105+
{
106+
mPlugins.erase( it );
107+
}
97108
}
98109

99110
void QgsPluginRegistry::unloadAll()
100111
{
101-
for ( std::map<QString, QgsPluginMetadata*>::iterator it = plugins.begin();
102-
it != plugins.end();
112+
for ( QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.begin();
113+
it != mPlugins.end();
103114
it++ )
104115
{
105-
if ( isPythonPlugin( it->second->name() ) )
116+
if (isPythonPlugin(it.key()))
106117
{
107-
if ( mPythonUtils )
108-
mPythonUtils->unloadPlugin( it->second->library() );
118+
if (mPythonUtils)
119+
mPythonUtils->unloadPlugin(it->library());
109120
else
110121
QgsDebugMsg( "warning: python utils is NULL" );
111122
}
112123
else
113124
{
114-
if ( it->second->plugin() )
115-
it->second->plugin()->unload();
125+
if ( it->plugin() )
126+
it->plugin()->unload();
116127
else
117-
QgsDebugMsg( "warning: plugin is NULL:" + it->second->name() );
128+
QgsDebugMsg("warning: plugin is NULL:" + it.key());
118129
}
119130
}
120131
}

‎src/app/qgspluginregistry.h

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,45 +19,63 @@
1919

2020
#ifndef QGSPLUGINREGISTRY_H
2121
#define QGSPLUGINREGISTRY_H
22-
#include <map>
22+
23+
#include <QMap>
24+
2325
class QgsPluginMetadata;
2426
class QgsPythonUtils;
2527
class QgisPlugin;
2628
class QString;
29+
2730
/**
2831
* \class QgsPluginRegistry
2932
* \brief This class tracks plugins that are currently loaded an provides
3033
* a means to fetch a pointer to a plugin and unload it
34+
*
35+
* plugin key is:
36+
* - C++ plugins: base name of plugin library, e.g. libgrassplugin
37+
* - Python plugins: module name (directory) of plugin, e.g. plugin_installer
3138
*/
3239
class QgsPluginRegistry
3340
{
3441
public:
3542
//! Returns the instance pointer, creating the object on the first call
3643
static QgsPluginRegistry* instance();
37-
//! Return the full path to the plugins library using the plugin name as a key
38-
QString library( QString pluginKey );
39-
//! Retrieve the metadata for a plugin by name
40-
QgsPluginMetadata * pluginMetadata( QString name );
41-
//! Retrieve a pointer to a loaded plugin by name
42-
QgisPlugin * plugin( QString name );
44+
45+
//! Check whether this module is loaded
46+
bool isLoaded( QString key );
47+
48+
//! Retrieve library of the plugin
49+
QString library( QString key );
50+
51+
//! Retrieve a pointer to a loaded plugin
52+
QgisPlugin * plugin( QString key );
53+
4354
//! Return whether the plugin is pythonic
44-
bool isPythonPlugin( QString name );
55+
bool isPythonPlugin( QString key );
56+
4557
//! Add a plugin to the map of loaded plugins
46-
void addPlugin( QString _library, QString _name, QgisPlugin * _plugin );
47-
//! Add a plugin written in python
48-
void addPythonPlugin( QString packageName, QString pluginName );
58+
void addPlugin( QString key, QgsPluginMetadata metadata );
59+
4960
//! Remove a plugin from the list of loaded plugins
50-
void removePlugin( QString name );
61+
void removePlugin( QString key );
62+
5163
//! Unload plugins
5264
void unloadAll();
65+
5366
//! Save pointer for python utils (needed for unloading python plugins)
5467
void setPythonUtils( QgsPythonUtils* pythonUtils );
68+
69+
//! Dump list of plugins
70+
void dump();
71+
5572
protected:
5673
//! protected constructor
5774
QgsPluginRegistry();
75+
5876
private:
5977
static QgsPluginRegistry* _instance;
60-
std::map<QString, QgsPluginMetadata*> plugins;
78+
QMap<QString, QgsPluginMetadata> mPlugins;
6179
QgsPythonUtils* mPythonUtils;
6280
};
6381
#endif //QgsPluginRegistry_H

0 commit comments

Comments
 (0)
Please sign in to comment.