diff --git a/CHANGELOG.md b/CHANGELOG.md index ee6cc67c..013734d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/cadastre/cadastre_menu.py b/cadastre/cadastre_menu.py index 89bf988f..9af16844 100644 --- a/cadastre/cadastre_menu.py +++ b/cadastre/cadastre_menu.py @@ -24,6 +24,7 @@ from time import time from qgis.core import ( + Qgis, QgsApplication, QgsLayoutExporter, QgsPrintLayout, @@ -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": ( @@ -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