Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #2260 from bstroebl/fixDissolve
[PROCESSING] Fix Progress bar in Dissolve
  • Loading branch information
m-kuhn committed Aug 19, 2015
2 parents fd23859 + 1f81109 commit d5d7c58
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions python/plugins/processing/algs/qgis/Dissolve.py
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 d5d7c58

Please sign in to comment.