Feature request #2541
Add canUninstall function to python plugin modules
|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.
#2 Updated by Borys Jurgiel over 10 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 10 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.