[dbmanager] avoid double extension when exports to file a table

This commit is contained in:
Salvatore Larosa 2013-08-02 17:37:36 +02:00
parent 3644402bc7
commit 65f9ec7201

View File

@ -69,7 +69,7 @@ class DlgExportVector(QDialog, Ui_Dialog):
filename = QFileDialog.getSaveFileName(self, self.tr("Choose where to save the file"), lastDir, self.tr("Shapefiles") + " (*.shp)")
if filename == "":
return
if filename[:-4] != ".shp":
if filename[-4:] != ".shp":
filename += ".shp"
# store the last used dir and format
settings.setValue("/db_manager/lastUsedDir", QFileInfo(filename).filePath())