Skip to content
Permalink
Browse files

[processing] fixed using temporary files in field calculator

  • Loading branch information
volaya committed Jun 22, 2015
1 parent 1579a68 commit 5013bb5600154d185e6adc4be487c7907737e81a
@@ -151,9 +151,6 @@ def checkParameterValuesBeforeExecuting(self):
if newField and len(fieldName) == 0:
return self.tr('Field name is not set. Please enter a field name')

outputName = self.getOutputValue(self.OUTPUT_LAYER).strip()
if outputName == '':
return self.tr('Output is not set. Please specify valid filename')

def getCustomParametersDialog(self):
return FieldsCalculatorDialog(self)
@@ -142,8 +142,8 @@ def selectFile(self):
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)
tuple(re.findall("\*(\.[a-z]{1,10})", fileFilter))):
ext = re.search("\*(\.[a-z]{1,10})", selectedFileFilter)
if ext:
filename = filename + ext.group(1)
self.leOutputFile.setText(filename)
@@ -184,8 +184,7 @@ def setParamValues(self):
self.alg.setParameterValue('NEW_FIELD',
self.mNewFieldGroupBox.isChecked())
self.alg.setParameterValue('FORMULA', self.builder.expressionText())
self.alg.setOutputValue('OUTPUT_LAYER',
self.leOutputFile.text())
self.alg.setOutputValue('OUTPUT_LAYER', self.leOutputFile.text().strip() or None)

msg = self.alg.checkParameterValuesBeforeExecuting()
if msg:

0 comments on commit 5013bb5

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