mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
[Plugin Manager] Better cope with broken plugins
This commit is contained in:
parent
b005f10470
commit
eda9cd3380
@ -193,6 +193,7 @@ def startPlugin(packageName):
|
||||
global plugins, active_plugins, iface
|
||||
|
||||
if packageName in active_plugins: return False
|
||||
if packageName not in sys.modules: return False
|
||||
|
||||
package = sys.modules[packageName]
|
||||
|
||||
|
@ -484,8 +484,9 @@ void QgsPluginManager::pluginItemChanged( QStandardItem * item )
|
||||
QgsDebugMsg( " Loading plugin: " + id );
|
||||
loadPlugin( id );
|
||||
}
|
||||
else if ( ! item->checkState() && isPluginLoaded( id ) )
|
||||
else if ( ! item->checkState() )
|
||||
{
|
||||
// don't test if isPluginLoaded, to allow disable also plugins taht weren't successfully loaded
|
||||
QgsDebugMsg( " Unloading plugin: " + id );
|
||||
unloadPlugin( id );
|
||||
}
|
||||
|
@ -383,11 +383,12 @@ void QgsPluginRegistry::unloadPythonPlugin( QString packageName )
|
||||
if ( isLoaded( packageName ) )
|
||||
{
|
||||
mPythonUtils->unloadPlugin( packageName );
|
||||
// add to settings
|
||||
QSettings settings;
|
||||
settings.setValue( "/PythonPlugins/" + packageName, false );
|
||||
QgsDebugMsg( "Python plugin successfully unloaded: " + packageName );
|
||||
}
|
||||
|
||||
// disable the plugin no matter if successfully loaded or not
|
||||
QSettings settings;
|
||||
settings.setValue( "/PythonPlugins/" + packageName, false );
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user