mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
[processing] fixed adding extension to output filenames in batch interface
fixes #10444
This commit is contained in:
parent
a9dab06a6a
commit
7f061d2d75
@ -16,6 +16,7 @@
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
import re
|
||||
|
||||
__author__ = 'Victor Olaya'
|
||||
__date__ = 'August 2012'
|
||||
@ -77,10 +78,15 @@ class BatchOutputSelectionPanel(QWidget):
|
||||
path = unicode(settings.value('/Processing/LastBatchOutputPath'))
|
||||
else:
|
||||
path = ''
|
||||
filename = QFileDialog.getSaveFileName(self, self.tr('Save file'), path,
|
||||
filefilter)
|
||||
filename, selectedFileFilter = QFileDialog.getSaveFileNameAndFilter(self,
|
||||
self.tr('Save file'), path, filefilter)
|
||||
print filename, selectedFileFilter
|
||||
if filename:
|
||||
filename = unicode(filename)
|
||||
if not filename.lower().endswith(
|
||||
tuple(re.findall("\*(\.[a-z]{1,10})", filefilter))):
|
||||
ext = re.search("\*(\.[a-z]{1,10})", selectedFileFilter)
|
||||
if ext:
|
||||
filename += ext.group(1)
|
||||
settings.setValue('/Processing/LastBatchOutputPath', os.path.dirname(filename))
|
||||
dlg = AutofillDialog(self.alg)
|
||||
dlg.exec_()
|
||||
|
Loading…
x
Reference in New Issue
Block a user