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 4, 2024
1 parent 5abad34 commit 0749430
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions libqfieldsync/offline_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,20 @@ def _convert(self, project: QgsProject) -> None:

if layer_action == SyncAction.OFFLINE:
if self.project_configuration.offline_copy_only_aoi:
if (
layer.geometryType() is not Qgis.GeometryType.Null
and layer.geometryType() is not 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:
try:
extent = QgsCoordinateTransform(
QgsCoordinateReferenceSystem(self.area_of_interest_crs),
Expand Down

0 comments on commit 0749430

Please sign in to comment.