Skip to content

Commit

Permalink
Show unknown feature count instead of misleading 0 in sublayer dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn authored Nov 28, 2017
1 parent 7a09f08 commit d31f60b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gui/qgssublayersdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
Expand Down
3 changes: 2 additions & 1 deletion src/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit d31f60b

Please sign in to comment.