Skip to content
Permalink
Browse files

More responsive feedback when using iterate mode

  • Loading branch information
nyalldawson committed Jun 12, 2017
1 parent b9e0b46 commit 4b81630aa644e513cbbad84bd7b7d9ab8cce2651
Showing with 7 additions and 1 deletion.
  1. +7 −1 python/plugins/processing/gui/AlgorithmExecutor.py
@@ -79,7 +79,11 @@ def executeIterating(alg, parameters, paramToIter, context, feedback):

iter_source = QgsProcessingParameters.parameterAsSource(parameter_definition, parameters, context)
sink_list = []
for feat in iter_source.getFeatures():
if iter_source.featureCount() == 0:
return False

total = 100.0 / iter_source.featureCount()
for current, feat in enumerate(iter_source.getFeatures()):
if feedback.isCanceled():
return False

@@ -88,6 +92,8 @@ def executeIterating(alg, parameters, paramToIter, context, feedback):
sink.addFeature(feat)
del sink

feedback.setProgress(int(current * total))

# store output values to use them later as basenames for all outputs
outputs = {}
for out in alg.destinationParameterDefinitions():

0 comments on commit 4b81630

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