Skip to content
Permalink
Browse files

Remove unused QgsVectorLayerInterruptionCheckerDuringCountSymbolFeatu…

…res class
  • Loading branch information
nyalldawson committed Feb 19, 2018
1 parent 2c53630 commit 1014e5c7a12afa05d809ef76360097c59facf356
Showing with 0 additions and 40 deletions.
  1. +0 −40 src/core/qgsvectorlayer.cpp
@@ -698,46 +698,6 @@ long QgsVectorLayer::featureCount( const QString &legendKey ) const
return mSymbolFeatureCountMap.value( legendKey );
}

/**
* \ingroup core
* Used by QgsVectorLayer::countSymbolFeatures() to provide an interruption checker
* \note not available in Python bindings
*/
class QgsVectorLayerInterruptionCheckerDuringCountSymbolFeatures: public QgsInterruptionChecker
{
public:

//! Constructor
explicit QgsVectorLayerInterruptionCheckerDuringCountSymbolFeatures( QProgressDialog *dialog )
: mDialog( dialog )
{
}

bool mustStop() const override
{
if ( mDialog->isVisible() )
{
// So that we get a chance of hitting the Abort button
#ifdef Q_OS_LINUX
// For some reason on Windows hasPendingEvents() always return true,
// but one iteration is actually enough on Windows to get good interactivity
// whereas on Linux we must allow for far more iterations.
// For safety limit the number of iterations
int nIters = 0;
while ( QCoreApplication::hasPendingEvents() && ++nIters < 100 )
#endif
{
QCoreApplication::processEvents();
}
return mDialog->wasCanceled();
}
return false;
}

private:
QProgressDialog *mDialog = nullptr;
};

QgsVectorLayerFeatureCounter *QgsVectorLayer::countSymbolFeatures()
{
if ( mSymbolFeatureCounted || mFeatureCounter )

0 comments on commit 1014e5c

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