Skip to content

Commit

Permalink
Make QFieldSync work with older QGIS versions prior to 3.30
Browse files Browse the repository at this point in the history
  • Loading branch information
suricactus committed Jan 8, 2024
1 parent 5c58379 commit a8e9a3a
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions libqfieldsync/offliners.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,20 @@ def convert_to_offline(
if bbox and bbox.isFinite():
only_selected = True
for layer in layers:
if (
layer.geometryType() is Qgis.GeometryType.Null
or layer.geometryType() is Qgis.GeometryType.Unknown
):
if Qgis.QGIS_VERSION_INT >= 33000:
no_geometry_types = [
Qgis.GeometryType.Null,
Qgis.GeometryType.Unknown,
]
else:
from qgis.core import QgsWkbTypes

no_geometry_types = [
QgsWkbTypes.GeometryType.Null,
QgsWkbTypes.GeometryType.Unknown,
]

if layer.geometryType() not in no_geometry_types:
# ensure that geometry-less layers do not have selected features that would interfere with the process
layer.removeSelection()
else:
Expand Down

0 comments on commit a8e9a3a

Please sign in to comment.