Skip to content

Fix QGIS plugin reload cleanup - #529

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

Fix QGIS plugin reload cleanup#529
giswqs merged 1 commit 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:21
@github-actions

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request May 12, 2026 04:24 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 aims to reduce QGIS Plugin Reloader warnings by proactively cleaning up SamGeo plugin UI elements (toolbars/menus) that may persist after unload() during reload cycles.

Changes:

  • Added best-effort cleanup utilities to detach and schedule deletion of stale toolbars/menus.
  • Removed stale toolbars by object name before creating a new toolbar and again during unload().
  • Attempted to remove stale plugin menus by title during initialization and unload().

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

Comment thread qgis-samgeo-plugin/samgeo_plugin.py
Comment thread qgis-samgeo-plugin/samgeo_plugin.py
Comment thread qgis-samgeo-plugin/samgeo_plugin.py
Comment thread qgis-samgeo-plugin/samgeo_plugin.py
@giswqs giswqs changed the title [codex] Fix QGIS plugin reload cleanup Fix QGIS plugin reload cleanup May 12, 2026
@giswqs
giswqs merged commit 3dc9620 into main May 12, 2026
14 checks passed
@giswqs
giswqs deleted the codex/fix-plugin-reload-cleanup branch May 12, 2026 13:36
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