Is it possible to listen for plugin removal before the plugin is removed?
We save global settings as user interacts with the plugin, but want to reset plugin specific global settings when user uninstalls the plugin.
You can use the unload()
method of your plugin, which is called also when your plugin is uninstalled.
So, the best place to do your cleaning is there, the unload()
.
See What is the purpose of some functions and files in QGIS Python plugins? for details.