Skip to content
Permalink
Browse files

[Plugin Manager] Better cope with broken plugins

  • Loading branch information
borysiasty committed Jun 6, 2013
1 parent b005f10 commit eda9cd338047602f125b98190c98faacb1810a32
Showing with 7 additions and 4 deletions.
  1. +1 −0 python/utils.py
  2. +2 −1 src/app/pluginmanager/qgspluginmanager.cpp
  3. +4 −3 src/app/qgspluginregistry.cpp
@@ -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 );
}


0 comments on commit eda9cd3

Please sign in to comment.
You can’t perform that action at this time.