Skip to content
Permalink
Browse files
followup 1ac053f
  • Loading branch information
alexbruy committed Apr 27, 2017
1 parent 1ac053f commit eeba0efc36d998023d31e63cde905f1ced83cec9
Showing with 3 additions and 2 deletions.
  1. +3 −2 python/plugins/processing/algs/qgis/SaveSelectedFeatures.py
@@ -69,10 +69,11 @@ def processAlgorithm(self, context, feedback):
writer = output.getVectorWriter(vectorLayer.fields(), vectorLayer.wkbType(), vectorLayer.crs(), context)

features = vectorLayer.getSelectedFeatures()
if len(features) == 0:
count = int(vectorLayer.selectedFeatureCount())
if count == 0:
raise GeoAlgorithmExecutionException(self.tr('There are no selected features in the input layer.'))

total = 100.0 / len(features)
total = 100.0 / count
for current, feat in enumerate(features):
writer.addFeature(feat)
feedback.setProgress(int(current * total))

0 comments on commit eeba0ef

Please sign in to comment.