Skip to content

Commit

Permalink
Merge pull request #6656 from nyalldawson/gdal_dlg
Browse files Browse the repository at this point in the history
[processing][gdal] Skip expensive parameter validation when just showing command in dialog
  • Loading branch information
alexbruy committed Mar 21, 2018
2 parents 29e00ae + 044470d commit 51ce2fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/GdalAlgorithmDialog.py
Expand Up @@ -113,7 +113,7 @@ def parametersHaveChanged(self):
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
Expand Down
9 changes: 5 additions & 4 deletions python/plugins/processing/algs/gdal/buildvrt.py
Expand Up @@ -115,10 +115,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
# 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:
layers = []
for l in self.parameterAsLayerList(parameters, self.INPUT, context):
layers.append(l.source())
f.write('\n'.join(layers))
if executing:
layers = []
for l in self.parameterAsLayerList(parameters, self.INPUT, context):
layers.append(l.source())
f.write('\n'.join(layers))
arguments.append('-input_file_list')
arguments.append(listFile)

Expand Down

0 comments on commit 51ce2fb

Please sign in to comment.