[processing][gdal] Skip expensive parameter validation when just showing command in dialog

This commit is contained in:
Nyall Dawson 2018-03-21 15:10:16 +10:00
parent e0255b305d
commit 044470d38f
2 changed files with 6 additions and 5 deletions

View File

@ -113,7 +113,7 @@ class GdalParametersPanel(ParametersPanel):
parameters[output.name()] = self.tr("[temporary file]")
for p in self.alg.parameterDefinitions():
if (not p.name() in parameters and not p.flags() & QgsProcessingParameterDefinition.FlagOptional) \
or (not p.checkValueIsAcceptable(parameters[p.name()], context)):
or (not p.checkValueIsAcceptable(parameters[p.name()])):
# not ready yet
self.text.setPlainText('')
return

View File

@ -115,6 +115,7 @@ class buildvrt(GdalAlgorithm):
# length of the command will be longer then allowed in command prompt
listFile = os.path.join(QgsProcessingUtils.tempFolder(), 'buildvrtInputFiles.txt')
with open(listFile, 'w') as f:
if executing:
layers = []
for l in self.parameterAsLayerList(parameters, self.INPUT, context):
layers.append(l.source())