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)

python_plugin_can_uninstall.diff (3.1 KB ) - added by ccrook 14 years ago.
Patch to provide the uninstall management functionality

Download all attachments as: .zip

Change History (5)

by ccrook, 14 years ago

Patch to provide the uninstall management functionality

comment:1 by ccrook, 14 years ago

Type: bugpatch

comment:2 by borysiasty, 14 years ago

Status: newassigned

comment:3 by borysiasty, 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 borysiasty, 14 years ago

Resolution: fixed
Status: assignedclosed

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.

Note: See TracTickets for help on using tickets.