Skip to content

Commit

Permalink
Merge branch 'dev-QGIS3' into staging-QGIS3
Browse files Browse the repository at this point in the history
  • Loading branch information
mba committed Nov 13, 2019
2 parents 8afda6c + 081c3d4 commit 9301f9c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
6 changes: 3 additions & 3 deletions project.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,12 +702,12 @@ def _getDbConnection(self):
'''
Gets the database connection
'''

if os.name == "nt":
conn = utils.spatialite_connect(self.database)
else:
conn = sqlite3.connect(self.database)
conn.enable_load_extension(True)
conn.load_extension('/Library/Frameworks/SQLite3.framework/Versions/E/Modules/mod_spatialite.dylib')
return conn

return conn
2 changes: 1 addition & 1 deletion widgets/data_checker/data_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def checkFeatureGeometry(self, feature):
errors = list()

if feature.geometry() is None or feature.geometry().isEmpty():
errors.append((feature, None, QCoreApplication.translate('DataChecker','Geometry is empty')))
errors.append((feature, None, QCoreApplication.translate('DataChecker', 'Geometry is empty')))
else:
errors2 = feature.geometry().validateGeometry()

Expand Down
2 changes: 1 addition & 1 deletion widgets/data_checker/error_summary_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def exportToCsv(self):
dialog = QFileDialog()
dialog.setFileMode(QFileDialog.AnyFile)
dialog.setAcceptMode(QFileDialog.AcceptSave)
dialog.setNameFilter('CSV file (*.csv)');
dialog.setNameFilter('CSV file (*.csv)')
dialog.setWindowTitle(QCoreApplication.translate('ErrorSummaryDialog','Select the csv location'))
dialog.setSizeGripEnabled(False)
result = dialog.exec_()
Expand Down
5 changes: 3 additions & 2 deletions widgets/export_gml/export_gml.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def run(self):
dialog.setAcceptMode(QFileDialog.AcceptSave)
dialog.setNameFilter('GML file (*.gml)')
dialog.setDefaultSuffix('gml')
dialog.setWindowTitle(QCoreApplication.translate('ExportGML','Select the gml location'))
dialog.setWindowTitle(QCoreApplication.translate('ExportGML', 'Select the gml location'))
dialog.setSizeGripEnabled(False)
result = dialog.exec_()

Expand Down Expand Up @@ -153,7 +153,8 @@ def run(self):
progress.setValue(progress.value() + 1)

file = open(gml_filename, 'wb')
file.write(gml.toprettyxml('','\n','utf-8'))
pretty_gml = gml.toprettyxml('', '\n', 'utf-8')
file.write(pretty_gml.replace(b'xsi:nil="true"', b''))
file.close()
shutil.rmtree(temp_dir)

Expand Down
6 changes: 3 additions & 3 deletions widgets/import_data/import_shp_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ def _loadMapping(self):
if self.mapping.destinationLayerName() is not None and qgis_layer is None:
QMessageBox.critical(
self,
QCoreApplication.translate('ImportShpDialog','Error'),
QCoreApplication.translate('ImportShpDialog','Destination layer {} not found.').format(self.mapping.destinationLayerName())
QCoreApplication.translate('ImportShpDialog', 'Error'),
QCoreApplication.translate('ImportShpDialog', 'Destination layer {} not found.').format(self.mapping.destinationLayerName())
)
return

Expand Down Expand Up @@ -415,7 +415,7 @@ def _launchImport(self):
self.close()

# Progress bar + message
progressMessageBar = PagLuxembourg.main.qgis_interface.messageBar().createMessage(QCoreApplication.translate('ImportShpDialog','Importing {}').format(self.shplayer.source()))
progressMessageBar = PagLuxembourg.main.qgis_interface.messageBar().createMessage(QCoreApplication.translate('ImportShpDialog', 'Importing {}').format(self.shplayer.source()))
progress = QProgressBar()
progress.setMaximum(self.shplayer.featureCount())
progress.setAlignment(Qt.AlignLeft|Qt.AlignVCenter)
Expand Down
6 changes: 3 additions & 3 deletions widgets/import_data/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,11 @@ def _getCleanGeometry(self, geometry, simplify_tolerance=0):
return None

# Simplify seems to corrupt some geometries, so we have to recreate the geometry
if geometry.wkbType() == QgsWkbTypes.Point:
if geometry.type() == QgsWkbTypes.PointGeometry:
return QgsGeometry.fromPointXY(clean_geometry.asPoint())
elif geometry.wkbType() == QgsWkbTypes.LineString:
elif geometry.type() == QgsWkbTypes.LineGeometry:
return QgsGeometry.fromPolylineXY(clean_geometry.asPolyline())
elif geometry.wkbType() == QgsWkbTypes.Polygon:
elif geometry.type() == QgsWkbTypes.PolygonGeometry:
return QgsGeometry.fromPolygonXY(clean_geometry.asPolygon())

return None
Expand Down

0 comments on commit 9301f9c

Please sign in to comment.