Skip to content

Commit 6604def

Browse files
committedMar 22, 2018
[processing][gdal] Skip expensive parameter validation when just showing command in dialog
(cherry-picked from 044470d)
1 parent 50c239b commit 6604def

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed
 

‎python/plugins/processing/algs/gdal/GdalAlgorithmDialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def parametersHaveChanged(self):
113113
parameters[output.name()] = self.tr("[temporary file]")
114114
for p in self.alg.parameterDefinitions():
115115
if (not p.name() in parameters and not p.flags() & QgsProcessingParameterDefinition.FlagOptional) \
116-
or (not p.checkValueIsAcceptable(parameters[p.name()], context)):
116+
or (not p.checkValueIsAcceptable(parameters[p.name()])):
117117
# not ready yet
118118
self.text.setPlainText('')
119119
return

‎python/plugins/processing/algs/gdal/buildvrt.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
115115
# length of the command will be longer then allowed in command prompt
116116
listFile = os.path.join(QgsProcessingUtils.tempFolder(), 'buildvrtInputFiles.txt')
117117
with open(listFile, 'w') as f:
118-
layers = []
119-
for l in self.parameterAsLayerList(parameters, self.INPUT, context):
120-
layers.append(l.source())
121-
f.write('\n'.join(layers))
118+
if executing:
119+
layers = []
120+
for l in self.parameterAsLayerList(parameters, self.INPUT, context):
121+
layers.append(l.source())
122+
f.write('\n'.join(layers))
122123
arguments.append('-input_file_list')
123124
arguments.append(listFile)
124125

0 commit comments

Comments
 (0)
Please sign in to comment.