Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyQgis Plugin: Differentiaite the kind of unloading a plugin #28233

Closed
qgib opened this issue Nov 8, 2018 · 1 comment
Closed

PyQgis Plugin: Differentiaite the kind of unloading a plugin #28233

qgib opened this issue Nov 8, 2018 · 1 comment

Comments

@qgib
Copy link
Contributor

qgib commented Nov 8, 2018

Author Name: Friedrich Meckel (Friedrich Meckel)
Original Redmine Issue: 20413

Redmine category:python_plugins


Hello,
it seems to me that there are several different ways to unload a plugin

  • by quitting Qgis
  • by unloading the plugin by removing the checkbox in plugin dialog
  • by de-install the plugin from the plugin dialog
  • by an automatic unloading-loading cycle when an activated plugin is deinstalled and reinstalled

The last one might be unintetnional, but for the first three there are no signals which the plugin could connect to to differentiate bewteen these three types. But that is of interests when a plugin alters files outside of its dirctory which it wants to reset/recover when it is uninstalled, but not if Qgis is shut down.

@alexbruy
Copy link
Contributor

I'm afraid you are mixing different events here. There is only one way to unload plugin — call its unload() method. This method is called when user quits QGIS, deactivates plugin via Plugin Manager or uninstalls plugin. So you need to listen for QGIS signals/actions if you want to handle these events, nothing to do with the plugin itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants