Skip to content

Commit

Permalink
[PROCESSING] Fix Progress bar in Dissolve
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernhard Ströbl committed Aug 19, 2015
1 parent fd23859 commit 1f81109
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions python/plugins/processing/algs/qgis/Dissolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,17 @@ def processAlgorithm(self, progress):
vproviderA.crs())
outFeat = QgsFeature()
nElement = 0
nFeat = vproviderA.featureCount()
nFeat = vlayerA.selectedFeatureCount()

if nFeat == 0:
nFeat = vlayerA.featureCount()

if not useField:
first = True
features = vector.features(vlayerA)
for inFeat in features:
nElement += 1
progress.setPercentage(int(nElement / nFeat * 100))
progress.setPercentage(int(nElement * 100/ nFeat))
if first:
attrs = inFeat.attributes()
tmpInGeom = QgsGeometry(inFeat.geometry())
Expand All @@ -93,7 +97,7 @@ def processAlgorithm(self, progress):
features = vector.features(vlayerA)
for inFeat in features:
nElement += 1
progress.setPercentage(int(nElement / nFeat * 100))
progress.setPercentage(int(nElement * 100/ nFeat))
atMap = inFeat.attributes()
tempItem = atMap[field]
if unicode(tempItem).strip() == unicode(item).strip():
Expand Down

0 comments on commit 1f81109

Please sign in to comment.