mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
[dbmanager] avoid double extension when exports to file a table
This commit is contained in:
parent
3644402bc7
commit
65f9ec7201
@ -64,12 +64,12 @@ class DlgExportVector(QDialog, Ui_Dialog):
|
|||||||
def chooseOutputFile(self):
|
def chooseOutputFile(self):
|
||||||
# get last used dir and format
|
# get last used dir and format
|
||||||
settings = QSettings()
|
settings = QSettings()
|
||||||
lastDir = settings.value("/db_manager/lastUsedDir", "")
|
lastDir = settings.value("/db_manager/lastUsedDir", "")
|
||||||
# ask for a filename
|
# ask for a filename
|
||||||
filename = QFileDialog.getSaveFileName(self, self.tr("Choose where to save the file"), lastDir, self.tr("Shapefiles") + " (*.shp)")
|
filename = QFileDialog.getSaveFileName(self, self.tr("Choose where to save the file"), lastDir, self.tr("Shapefiles") + " (*.shp)")
|
||||||
if filename == "":
|
if filename == "":
|
||||||
return
|
return
|
||||||
if filename[:-4] != ".shp":
|
if filename[-4:] != ".shp":
|
||||||
filename += ".shp"
|
filename += ".shp"
|
||||||
# store the last used dir and format
|
# store the last used dir and format
|
||||||
settings.setValue("/db_manager/lastUsedDir", QFileInfo(filename).filePath())
|
settings.setValue("/db_manager/lastUsedDir", QFileInfo(filename).filePath())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user