Skip to content

Commit

Permalink
[processing] always use only selected features in 'save selected feat…
Browse files Browse the repository at this point in the history
…ures'
  • Loading branch information
volaya committed Jan 19, 2017
1 parent b44b9f8 commit 5e479fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/plugins/processing/algs/qgis/SaveSelectedFeatures.py
Expand Up @@ -28,7 +28,7 @@
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.parameters import ParameterVector
from processing.core.outputs import OutputVector
from processing.tools import dataobjects, vector
from processing.tools import dataobjects


class SaveSelectedFeatures(GeoAlgorithm):
Expand All @@ -55,8 +55,8 @@ def processAlgorithm(self, feedback):
writer = output.getVectorWriter(vectorLayer.fields(),
vectorLayer.wkbType(), vectorLayer.crs())

features = vector.features(vectorLayer)
total = 100.0 / len(features)
features = vectorLayer.selectedFeaturesIterator()
total = 100.0 / int(vectorLayer.selectedFeatureCount())
for current, feat in enumerate(features):
writer.addFeature(feat)
feedback.setProgress(int(current * total))
Expand Down

0 comments on commit 5e479fc

Please sign in to comment.