File tree 3 files changed +7
-4
lines changed
3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,7 @@ def startPlugin(packageName):
193
193
global plugins , active_plugins , iface
194
194
195
195
if packageName in active_plugins : return False
196
+ if packageName not in sys .modules : return False
196
197
197
198
package = sys .modules [packageName ]
198
199
Original file line number Diff line number Diff line change @@ -484,8 +484,9 @@ void QgsPluginManager::pluginItemChanged( QStandardItem * item )
484
484
QgsDebugMsg ( " Loading plugin: " + id );
485
485
loadPlugin ( id );
486
486
}
487
- else if ( ! item->checkState () && isPluginLoaded ( id ) )
487
+ else if ( ! item->checkState () )
488
488
{
489
+ // don't test if isPluginLoaded, to allow disable also plugins taht weren't successfully loaded
489
490
QgsDebugMsg ( " Unloading plugin: " + id );
490
491
unloadPlugin ( id );
491
492
}
Original file line number Diff line number Diff line change @@ -383,11 +383,12 @@ void QgsPluginRegistry::unloadPythonPlugin( QString packageName )
383
383
if ( isLoaded ( packageName ) )
384
384
{
385
385
mPythonUtils ->unloadPlugin ( packageName );
386
- // add to settings
387
- QSettings settings;
388
- settings.setValue ( " /PythonPlugins/" + packageName, false );
389
386
QgsDebugMsg ( " Python plugin successfully unloaded: " + packageName );
390
387
}
388
+
389
+ // disable the plugin no matter if successfully loaded or not
390
+ QSettings settings;
391
+ settings.setValue ( " /PythonPlugins/" + packageName, false );
391
392
}
392
393
393
394
You can’t perform that action at this time.
0 commit comments