Skip to content
Permalink
Browse files

[processing] always use only selected features in 'save selected feat…

…ures'
  • Loading branch information
volaya committed Jan 19, 2017
1 parent b44b9f8 commit 5e479fc67ed56cf6a4b2e63083ba01c207a0099d
Showing with 3 additions and 3 deletions.
  1. +3 −3 python/plugins/processing/algs/qgis/SaveSelectedFeatures.py
@@ -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):
@@ -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))

0 comments on commit 5e479fc

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