Feature request #2541

Add canUninstall function to python plugin modules

Added by Chris Crook over 14 years ago. Updated over 14 years ago.

Assignee:Borys Jurgiel
Category:Python plugins
Pull Request or Patch supplied: Resolution:fixed
Easy fix?:No Copied to github as #:12601


Some modules need to manage behaviour when they are uninstalled (as opposed to just unloaded when qgis closes down). For example layer or renderer plugins may need to remove layers, reset renderers, or at least explain to users that projects made using them may no longer load.

This patch adds a canUninstall function to the plugin interface. If this is absent, or if it returns True, then the plugin will be uninstalled. If it returns false, then the plugin manager will not uninstall the plugin.

python_plugin_can_uninstall.diff Magnifier - Patch to provide the uninstall management functionality (3.07 KB) Chris Crook, 2010-03-10 07:15 PM


#1 Updated by Borys Jurgiel over 14 years ago

  • Status changed from Open to In Progress

#2 Updated by Borys Jurgiel over 14 years ago

But what with currently not loaded plugins? Your patch makes it impossible to uninstall them without prior loading. Probably such plugin should be loaded for a while (without calling initGui) just to test it's safely uninstallable. Or, the simplest solution is to always return True for not loaded plugins.

#3 Updated by Borys Jurgiel over 14 years ago

  • Resolution set to fixed
  • Status changed from In Progress to Closed

Oh I see, you mean rather disabling than uninstalling. I've applied it as c577cfbf (SVN r13051) renaming the plugin method to canBeUninstalled(). Will be implemented also in the plugin installer later.

Also available in: Atom PDF