Skip to content

Fix QGIS plugin reload cleanup#96

Merged
giswqs merged 2 commits into
mainfrom
codex/fix-plugin-reload-cleanup
May 12, 2026
Merged

Fix QGIS plugin reload cleanup#96
giswqs merged 2 commits into
mainfrom
codex/fix-plugin-reload-cleanup

Conversation

@giswqs

@giswqs giswqs commented May 12, 2026

Copy link
Copy Markdown
Member

Summary

Fix QGIS Plugin Reloader warnings caused by custom plugin toolbars and menus that can remain attached to the QGIS main window after unload().

Changes

  • Remove stale plugin toolbars by object name before creating a new toolbar.
  • Detach and schedule stale toolbars for deletion during unload.
  • Remove stale plugin menus by title before initialization and during unload.
  • Keep cleanup best-effort so reload/unload can continue even if QGIS has already detached a widget.

Validation

  • Ran python -m py_compile on the changed plugin entry-point file.
  • Ran git diff --check.

Copilot AI review requested due to automatic review settings May 12, 2026 04:23
@github-actions

github-actions Bot commented May 12, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot temporarily deployed to pull request May 12, 2026 04:25 Inactive

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves QGIS plugin reload/unload behavior by proactively cleaning up stale UI elements (toolbars/menus) that can remain attached to the QGIS main window, reducing Plugin Reloader warnings.

Changes:

  • Adds best-effort removal of existing/stale toolbars by object name before creating a new toolbar and during unload.
  • Adds best-effort removal of existing/stale plugin menus by title before initialization and during unload.
  • Centralizes toolbar/menu cleanup into helper methods that attempt to detach and schedule deletion safely.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread qgis_geoagent/open_geoagent/open_geoagent.py
Comment thread qgis_geoagent/open_geoagent/open_geoagent.py
Comment thread qgis_geoagent/open_geoagent/open_geoagent.py
@github-actions github-actions Bot temporarily deployed to pull request May 12, 2026 04:27 Inactive
@giswqs giswqs changed the title [codex] Fix QGIS plugin reload cleanup Fix QGIS plugin reload cleanup May 12, 2026
@giswqs giswqs merged commit d54f84d into main May 12, 2026
9 checks passed
@giswqs giswqs deleted the codex/fix-plugin-reload-cleanup branch May 12, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants