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

Adapt for topology and geometrychecker plugin name changes in 3.28 #122

Open
wants to merge 5 commits into
base: dev-QGIS3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def initGui(self):
"""
found = False
for action in self.iface.vectorMenu().actions():
if action.parent().objectName() == u'qgis_plugin_geometrycheckerplugin':
if action.parent().objectName() in (u'qgis_plugin_geometrycheckerplugin', u'qgis_plugin_plugin_geometrychecker'):
found = True
self.topoclean_widget = TopoClean(action)
self.pag_actions.append(self.add_action(
Expand All @@ -288,7 +288,7 @@ def initGui(self):
# Topology checker
found = False
for action in self.iface.vectorToolBar().actions():
if action.parent().objectName() == u'qgis_plugin_topolplugin':
if action.parent().objectName() in (u'qgis_plugin_topolplugin', u'qgis_plugin_plugin_topology'):
found = True
self.topology_widget = TopologyChecker(action)
self.pag_actions.append(self.add_action(
Expand Down
6 changes: 5 additions & 1 deletion project.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,11 @@ def _setupTopologicalSettings(self):
# Update snapping settings
QgsProject.instance().writeEntry('Digitizing', '/SnappingMode', 'current_layer')
QgsProject.instance().writeEntry('Digitizing', '/DefaultSnapType', 'to vertex and segment')
QgsProject.instance().writeEntry('Digitizing', '/DefaultSnapTolerance', 10.0)
# As of QGIS 3.34, writing floats to the project needs a special method call
try:
QgsProject.instance().writeEntry('Digitizing', '/DefaultSnapTolerance', 10.0)
except TypeError:
QgsProject.instance().writeEntryDouble('Digitizing', '/DefaultSnapTolerance', 10.0)
QgsProject.instance().writeEntry('Digitizing', '/DefaultSnapToleranceUnit', QgsTolerance.Pixels)

QgsProject.instance().snappingConfigChanged.emit(QgsSnappingConfig(QgsProject.instance()))
Expand Down