Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix missing name and progress for feature counter task
  • Loading branch information
nyalldawson committed May 16, 2017
1 parent a517c68 commit 59c9743
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions 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() )
Expand Down Expand Up @@ -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;
Expand Down

1 comment on commit 59c9743

@m-kuhn
Copy link
Member

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Please sign in to comment.