Skip to content
Permalink
Browse files

[sextante] fix issue with non-ASCII characters in layer selector

  • Loading branch information
alexbruy committed May 29, 2013
1 parent 23782b7 commit f1f17ed911480ec3acaec75ea8a87492ae3481be
Showing with 3 additions and 3 deletions.
  1. +3 −3 python/plugins/sextante/gui/InputLayerSelectorPanel.py
@@ -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.
You can’t perform that action at this time.