Skip to content
Permalink
Browse files

Fix python error when trying to export db manager table

  • Loading branch information
nyalldawson committed Feb 13, 2018
1 parent 6b4e734 commit ad849615a3fb6b8a9934e1ea7108652168a3125d
Showing with 6 additions and 6 deletions.
  1. +6 −6 python/plugins/db_manager/dlg_export_vector.py
@@ -78,16 +78,16 @@ def chooseOutputFile(self):
lastUsedDir = settings.value(self.lastUsedVectorDirSettingsKey, ".")

# get selected filter
selectedFilter = self.cboFileFormat.currentData()
selected_driver = self.cboFileFormat.currentData()
selected_filter = QgsVectorFileWriter.filterForDriver(selected_driver)

# ask for a filename
filename, filter = QFileDialog.getSaveFileName(self, self.tr("Choose where to save the file"), lastUsedDir,
selectedFilter)
selected_filter)
if filename == "":
return

filterString = QgsVectorFileWriter.filterForDriver(selectedFilter)
ext = filterString[filterString.find('.'):]
ext = selected_filter[selected_filter.find('.'):]
ext = ext[:ext.find(' ')]

if not filename.lower().endswith(ext):
@@ -112,8 +112,8 @@ def populateEncodings(self):

def populateFileFilters(self):
# populate the combo with supported vector file formats
for name, filt in list(QgsVectorFileWriter.ogrDriverList().items()):
self.cboFileFormat.addItem(name, filt)
for driver in QgsVectorFileWriter.ogrDriverList():
self.cboFileFormat.addItem(driver.longName, driver.driverName)

# set the last used filter
settings = QgsSettings()

0 comments on commit ad84961

Please sign in to comment.
You can’t perform that action at this time.