Skip to content
Permalink
Browse files

Show unknown feature count instead of misleading 0 in sublayer dialog

  • Loading branch information
nirvn committed Nov 28, 2017
1 parent 7a09f08 commit d31f60baa5ebf90a3b6d75f1ef2ec5134422bb93
Showing with 3 additions and 2 deletions.
  1. +1 −1 src/gui/qgssublayersdialog.cpp
  2. +2 −1 src/providers/ogr/qgsogrprovider.cpp
@@ -136,7 +136,7 @@ void QgsSublayersDialog::populateLayerTable( const QgsSublayersDialog::LayerDefi
QStringList elements;
elements << QString::number( item.layerId ) << item.layerName;
if ( mShowCount )
elements << QString::number( item.count );
elements << ( item.count == -1 ? tr( "Unknown" ) : QString::number( item.count ) );
if ( mShowType )
elements << item.type;
layersTable->addTopLevelItem( new SubLayerItem( elements ) );
@@ -749,10 +749,11 @@ void QgsOgrProvider::addSubLayerDetailsToSubLayerList( int i, QgsOgrLayer *layer

QString geom = ogrWkbGeometryTypeName( layerGeomType );

// For feature count, -1 indicates an unknown count state
QStringList parts = QStringList()
<< QString::number( i )
<< layerName
<< ( layerFeatureCount == -1 ? tr( "Unknown" ) : QString::number( layerFeatureCount ) )
<< QString::number( layerFeatureCount )
<< geom
<< geometryColumnName;

0 comments on commit d31f60b

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