Opened 14 years ago
Closed 14 years ago
#2541 closed patch (fixed)
Add canUninstall function to python plugin modules
Reported by: | ccrook | Owned by: | borysiasty |
---|---|---|---|
Priority: | minor: annoyance | Milestone: | Version 1.5.0 |
Component: | Python plugins and bindings | Version: | Trunk |
Keywords: | Cc: | ||
Must Fix for Release: | No | Platform: | All |
Platform Version: | 1.5 | Awaiting user input: | no |
Description
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.
Attachments (1)
Change History (5)
by , 14 years ago
Attachment: | python_plugin_can_uninstall.diff added |
---|
comment:1 by , 14 years ago
Type: | bug → patch |
---|
comment:2 by , 14 years ago
Status: | new → assigned |
---|
comment:3 by , 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.
comment:4 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Oh I see, you mean rather disabling than uninstalling. I've applied it as r13050 renaming the plugin method to canBeUninstalled(). Will be implemented also in the plugin installer later.
Patch to provide the uninstall management functionality