Skip to content

Commit 5013bb5

Browse files
committed
[processing] fixed using temporary files in field calculator
1 parent 1579a68 commit 5013bb5

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

python/plugins/processing/algs/qgis/FieldsCalculator.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,6 @@ def checkParameterValuesBeforeExecuting(self):
151151
if newField and len(fieldName) == 0:
152152
return self.tr('Field name is not set. Please enter a field name')
153153

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

158155
def getCustomParametersDialog(self):
159156
return FieldsCalculatorDialog(self)

python/plugins/processing/algs/qgis/ui/FieldsCalculatorDialog.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ def selectFile(self):
142142
filename = unicode(files[0])
143143
selectedFileFilter = unicode(fileDialog.selectedNameFilter())
144144
if not filename.lower().endswith(
145-
tuple(re.findall("\*(\.[a-z]{1,5})", fileFilter))):
146-
ext = re.search("\*(\.[a-z]{1,5})", selectedFileFilter)
145+
tuple(re.findall("\*(\.[a-z]{1,10})", fileFilter))):
146+
ext = re.search("\*(\.[a-z]{1,10})", selectedFileFilter)
147147
if ext:
148148
filename = filename + ext.group(1)
149149
self.leOutputFile.setText(filename)
@@ -184,8 +184,7 @@ def setParamValues(self):
184184
self.alg.setParameterValue('NEW_FIELD',
185185
self.mNewFieldGroupBox.isChecked())
186186
self.alg.setParameterValue('FORMULA', self.builder.expressionText())
187-
self.alg.setOutputValue('OUTPUT_LAYER',
188-
self.leOutputFile.text())
187+
self.alg.setOutputValue('OUTPUT_LAYER', self.leOutputFile.text().strip() or None)
189188

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

0 commit comments

Comments
 (0)