Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove unused QgsVectorLayerInterruptionCheckerDuringCountSymbolFeatu…
…res class
  • Loading branch information
nyalldawson committed Feb 19, 2018
1 parent 2c53630 commit 1014e5c
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -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 )
Expand Down

0 comments on commit 1014e5c

Please sign in to comment.