Skip to content

Commit 2921588

Browse files
committed
DBManager: do not use translated string for geometry type name (fix #5764)
1 parent cbf405f commit 2921588

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

python/plugins/db_manager/dlg_add_geometry_column.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333

3434
class DlgAddGeometryColumn(QDialog, Ui_DlgAddGeometryColumn):
3535

36+
GEOM_TYPES = ["POINT", "LINESTRING", "POLYGON", "MULTIPOINT", "MULTILINESTRING", "MULTIPOLYGON", "GEOMETRYCOLLECTION"]
37+
3638
def __init__(self, parent=None, table=None, db=None):
3739
QDialog.__init__(self, parent)
3840
self.table = table
@@ -48,7 +50,7 @@ def createGeomColumn(self):
4850
return
4951

5052
name = self.editName.text()
51-
geom_type = self.cboType.currentText()
53+
geom_type = self.GEOM_TYPES[ self.cboType.currentIndex() ]
5254
dim = self.spinDim.value()
5355
try:
5456
srid = int(self.editSrid.text())

python/plugins/db_manager/dlg_create_table.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ def setModelData(self, editor, model, index):
8181

8282
class DlgCreateTable(QDialog, Ui_DlgCreateTable):
8383

84+
GEOM_TYPES = ["POINT", "LINESTRING", "POLYGON", "MULTIPOINT", "MULTILINESTRING", "MULTIPOLYGON", "GEOMETRYCOLLECTION"]
85+
8486
def __init__(self, item, parent=None):
8587
QDialog.__init__(self, parent)
8688
self.item = item
@@ -284,7 +286,7 @@ def createTable(self):
284286
QMessageBox.information(self, "sorry", "set geometry column name")
285287
return
286288

287-
geomType = str(self.cboGeomType.currentText())
289+
geomType = self.GEOM_TYPES[ self.cboGeomType.currentIndex() ]
288290
geomDim = self.spinGeomDim.value()
289291
try:
290292
geomSrid = int(self.editGeomSrid.text())

0 commit comments

Comments
 (0)