Skip to content
Permalink
Browse files

[sextante] If no extension is specified for an output file append the

extension from the selected file filter.
  • Loading branch information
rmgu
rmgu committed Jul 15, 2013
1 parent 33cbb6c commit df627b148d37b4c501aeb4cd48331051164c59e9
Showing with 6 additions and 0 deletions.
  1. +6 −0 python/plugins/sextante/gui/OutputSelectionPanel.py
@@ -23,6 +23,7 @@
__revision__ = '$Format:%H$'

import os.path
import re
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.gui import *
@@ -90,6 +91,11 @@ def saveToFile(self):
encoding = unicode(fileDialog.encoding())
self.output.encoding = encoding
filename = unicode(files[0])
selectedFilefilter = unicode(fileDialog.selectedNameFilter())
if not filename.lower().endswith(tuple(re.findall("\*(\.[a-z]{1,5})", filefilter))):
ext = re.search("\*(\.[a-z]{1,5})", selectedFilefilter)
if ext:
filename = filename + ext.group(1)
self.text.setText(filename)
settings.setValue("/SextanteQGIS/LastOutputPath", os.path.dirname(filename))
settings.setValue("/SextanteQGIS/encoding", encoding)

0 comments on commit df627b1

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