Skip to content

Commit

Permalink
Update test result for correct feature count state (uncounted)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 28, 2021
1 parent 686a814 commit 2de65c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/gui/qgssublayersdialog.cpp
Expand Up @@ -151,7 +151,9 @@ void QgsSublayersDialog::populateLayerTable( const QgsSublayersDialog::LayerDefi
QStringList elements;
elements << QString::number( item.layerId ) << item.layerName;
if ( mShowCount )
elements << ( item.count == -1 ? tr( "Unknown" ) : QString::number( item.count ) );
elements << ( item.count == static_cast< int >( Qgis::FeatureCountState::Uncounted ) ||
item.count == static_cast< int >( Qgis::FeatureCountState::UnknownCount )
? tr( "Unknown" ) : QString::number( item.count ) );
if ( mShowType )
elements << item.type;
if ( mShowDescription )
Expand Down
3 changes: 2 additions & 1 deletion tests/src/python/test_provider_shapefile.py
Expand Up @@ -34,6 +34,7 @@
QgsVectorDataProvider,
QgsWkbTypes,
QgsVectorLayerExporter,
Qgis
)
from qgis.PyQt.QtCore import QVariant
from qgis.testing import start_app, unittest
Expand Down Expand Up @@ -1085,7 +1086,7 @@ def testSkipFeatureCountOnSubLayers(self):
self.assertTrue(provider.isValid())
sublayers = provider.subLayers()
self.assertTrue(len(sublayers) > 1)
self.assertEqual(sublayers[0].split(QgsDataProvider.sublayerSeparator())[2], '-1')
self.assertEqual(int(sublayers[0].split(QgsDataProvider.sublayerSeparator())[2]), int(Qgis.FeatureCountState.Uncounted))

def testLayersOnSameOGRLayerWithAndWithoutFilter(self):
"""Test fix for https://github.com/qgis/QGIS/issues/43361"""
Expand Down

0 comments on commit 2de65c2

Please sign in to comment.