Skip to content

Commit d90348d

Browse files
Gustrynyalldawson
authored andcommittedAug 8, 2018
avoid CRS in the tooltip when the layer is not spatial
1 parent f145631 commit d90348d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎src/core/layertree/qgslayertreemodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ QVariant QgsLayerTreeModel::data( const QModelIndex &index, int role ) const
287287

288288
title = "<b>" + title.toHtmlEscaped() + "</b>";
289289

290-
if ( layer->crs().isValid() )
290+
if ( layer->isSpatial() && layer->crs().isValid() )
291291
{
292292
if ( QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( layer ) )
293293
title += tr( " (%1 - %2)" ).arg( QgsWkbTypes::displayString( vl->wkbType() ), layer->crs().authid() ).toHtmlEscaped();

‎src/core/qgsmaplayermodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ QVariant QgsMapLayerModel::data( const QModelIndex &index, int role ) const
290290
if ( title.isEmpty() )
291291
title = layer->name();
292292
title = "<b>" + title + "</b>";
293-
if ( layer->crs().isValid() )
293+
if ( layer->isSpatial() && layer->crs().isValid() )
294294
{
295295
if ( QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( layer ) )
296296
title = tr( "%1 (%2 - %3)" ).arg( title, QgsWkbTypes::displayString( vl->wkbType() ), layer->crs().authid() );

0 commit comments

Comments
 (0)
Please sign in to comment.