Skip to content

Commit

Permalink
Fix loading the plugin for QGIS < 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Jun 24, 2021
1 parent 8ea2f60 commit f86fef1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

## 1.12.1 - 2021-06-24

* Correction du chargement de l'extension avec QGIS < 3.10

## 1.12.0 - 2021-06-21

* Correction de l'export propriétaire à une commune
Expand Down
10 changes: 6 additions & 4 deletions cadastre/cadastre_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from time import time

from qgis.core import (
Qgis,
QgsApplication,
QgsLayoutExporter,
QgsPrintLayout,
Expand Down Expand Up @@ -79,9 +80,10 @@ def initGui(self):
main_icon = QIcon(os.path.join(plugin_dir, "icon.png"))

# Open the online help
self.help_action_about_menu = QAction(main_icon, 'Cadastre', self.iface.mainWindow())
self.iface.pluginHelpMenu().addAction(self.help_action_about_menu)
self.help_action_about_menu.triggered.connect(self.open_help)
if Qgis.QGIS_VERSION_INT >= 31000:
self.help_action_about_menu = QAction(main_icon, 'Cadastre', self.iface.mainWindow())
self.iface.pluginHelpMenu().addAction(self.help_action_about_menu)
self.help_action_about_menu.triggered.connect(self.open_help)

actions = {
"import_action": (
Expand Down Expand Up @@ -512,7 +514,7 @@ def open_message_dialog(self):
dialog.exec_()

def unload(self):
if self.help_action_about_menu:
if Qgis.QGIS_VERSION_INT >= 31000 and self.help_action_about_menu:
self.iface.pluginHelpMenu().removeAction(self.help_action_about_menu)
del self.help_action_about_menu

Expand Down

0 comments on commit f86fef1

Please sign in to comment.