Skip to content

Commit

Permalink
Only pass progress to runalg if it's SilentProgress
Browse files Browse the repository at this point in the history
Otherwise allow each algorithm to have its own progress
  • Loading branch information
ebrelsford authored and m-kuhn committed Aug 29, 2017
1 parent 3e587bc commit 18706d9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions python/plugins/processing/algs/qgis/ConcaveHull.py
Expand Up @@ -27,6 +27,7 @@

from qgis.core import QGis, QgsFeatureRequest, QgsFeature, QgsGeometry
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.SilentProgress import SilentProgress
from processing.core.parameters import ParameterVector
from processing.core.parameters import ParameterNumber
from processing.core.parameters import ParameterBoolean
Expand Down Expand Up @@ -63,11 +64,14 @@ def processAlgorithm(self, progress):
alpha = self.getParameterValue(self.ALPHA)
holes = self.getParameterValue(self.HOLES)
no_multigeom = self.getParameterValue(self.NO_MULTIGEOMETRY)
runalg_kwargs = {}
if isinstance(progress, SilentProgress):
runalg_kwargs['progress'] = progress

# Delaunay triangulation from input point layer
progress.setText(self.tr('Creating Delaunay triangles...'))
delone_triangles = processing.runalg("qgis:delaunaytriangulation",
layer, None, progress=progress)['OUTPUT']
layer, None, **runalg_kwargs)['OUTPUT']
delaunay_layer = processing.getObject(delone_triangles)

# Get max edge length from Delaunay triangles
Expand Down Expand Up @@ -104,7 +108,7 @@ def processAlgorithm(self, progress):
# Dissolve all Delaunay triangles
progress.setText(self.tr('Dissolving Delaunay triangles...'))
dissolved = processing.runalg("qgis:dissolve", delaunay_layer,
True, None, None, progress=progress)['OUTPUT']
True, None, None, **runalg_kwargs)['OUTPUT']
dissolved_layer = processing.getObject(dissolved)

# Save result
Expand Down

0 comments on commit 18706d9

Please sign in to comment.