Skip to content
Permalink
Browse files

Don't show empty menu entry when layers have no CRS set

  • Loading branch information
nyalldawson committed Sep 23, 2020
1 parent 9ca2d3b commit bddd3edb5199fb78b5496945cadda84d375bfd87
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/app/qgsapplayertreeviewmenuprovider.cpp
@@ -331,7 +331,8 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
menu->addAction( tr( "Zoom to &Visible Scale" ), QgisApp::instance(), &QgisApp::zoomToLayerScale );

QMenu *menuSetCRS = new QMenu( tr( "Layer CRS" ), menu );
QAction *actionCurrentCrs = new QAction( layer->crs().userFriendlyIdentifier(), menuSetCRS );
QAction *actionCurrentCrs = new QAction( layer->crs().isValid() ? layer->crs().userFriendlyIdentifier()
: tr( "No CRS" ), menuSetCRS );
actionCurrentCrs->setEnabled( false );
menuSetCRS->addAction( actionCurrentCrs );
// assign layer crs to project

0 comments on commit bddd3ed

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