Skip to content

Commit

Permalink
[sextante] fix issue with non-ASCII characters in layer selector
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed May 29, 2013
1 parent 23782b7 commit f1f17ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/plugins/sextante/gui/InputLayerSelectorPanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,21 @@ def __init__(self, options):
def showSelectionDialog(self):
# find the file dialog's working directory
settings = QtCore.QSettings()
text = str(self.text.currentText())
text = unicode(self.text.currentText())
if os.path.isdir(text):
path = text
elif os.path.isdir( os.path.dirname(text) ):
path = os.path.dirname(text)
elif settings.contains("/SextanteQGIS/LastInputPath"):
path = str(settings.value( "/SextanteQGIS/LastInputPath",QtCore.QVariant( "" ) ).toString())
path = unicode(settings.value( "/SextanteQGIS/LastInputPath",QtCore.QVariant( "" ) ).toString())
else:
path = ""

filename = QtGui.QFileDialog.getOpenFileName(self, "All files", path, "*.*")
if filename:
self.text.addItem(filename, filename)
self.text.setCurrentIndex(self.text.count() - 1)
settings.setValue("/SextanteQGIS/LastInputPath", os.path.dirname(str(filename)))
settings.setValue("/SextanteQGIS/LastInputPath", os.path.dirname(unicode(filename)))

def getValue(self):
return self.text.itemData(self.text.currentIndex()).toPyObject()

0 comments on commit f1f17ed

Please sign in to comment.