Skip to content
Permalink
Browse files
Fix missing name and progress for feature counter task
  • Loading branch information
nyalldawson committed May 16, 2017
1 parent a517c68 commit 59c974379ef1c2760aa3d450b08edd4fd1032167
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/core/qgsvectorlayerfeaturecounter.cpp
@@ -1,7 +1,8 @@
#include "qgsvectorlayerfeaturecounter.h"

QgsVectorLayerFeatureCounter::QgsVectorLayerFeatureCounter( QgsVectorLayer *layer, const QgsExpressionContext &context )
: mSource( new QgsVectorLayerFeatureSource( layer ) )
: QgsTask( tr( "Counting features in %1" ).arg( layer->name() ), QgsTask::CanCancel )
, mSource( new QgsVectorLayerFeatureSource( layer ) )
, mRenderer( layer->renderer()->clone() )
, mExpressionContext( context )
, mFeatureCount( layer->featureCount() )
@@ -55,7 +56,7 @@ bool QgsVectorLayerFeatureCounter::run()
}
++featuresCounted;

double p = ( featuresCounted / mFeatureCount ) * 100;
double p = ( static_cast< double >( featuresCounted ) / mFeatureCount ) * 100;
if ( p - progress > 1 )
{
progress = p;

1 comment on commit 59c9743

@m-kuhn

This comment has been minimized.

Copy link
Member

@m-kuhn m-kuhn commented on 59c9743 May 16, 2017

Thanks

Please sign in to comment.