Skip to content

Commit

Permalink
avoid CRS in the tooltip when the layer is not spatial
Browse files Browse the repository at this point in the history
(cherry-picked from d90348d)
  • Loading branch information
Gustry authored and nyalldawson committed Aug 8, 2018
1 parent c6bb3cd commit 1c51d69
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/layertree/qgslayertreemodel.cpp
Expand Up @@ -287,7 +287,7 @@ QVariant QgsLayerTreeModel::data( const QModelIndex &index, int role ) const

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

if ( layer->crs().isValid() )
if ( layer->isSpatial() && layer->crs().isValid() )
{
if ( QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( layer ) )
title += tr( " (%1 - %2)" ).arg( QgsWkbTypes::displayString( vl->wkbType() ), layer->crs().authid() ).toHtmlEscaped();
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmaplayermodel.cpp
Expand Up @@ -290,7 +290,7 @@ QVariant QgsMapLayerModel::data( const QModelIndex &index, int role ) const
if ( title.isEmpty() )
title = layer->name();
title = "<b>" + title + "</b>";
if ( layer->crs().isValid() )
if ( layer->isSpatial() && layer->crs().isValid() )
{
if ( QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( layer ) )
title = tr( "%1 (%2 - %3)" ).arg( title, QgsWkbTypes::displayString( vl->wkbType() ), layer->crs().authid() );
Expand Down

0 comments on commit 1c51d69

Please sign in to comment.