Skip to content

Commit

Permalink
Show "Change Data Source" option for mesh layers right click menu
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson authored and vcloarec committed Oct 6, 2021
1 parent 89a4f0b commit 16200ca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/qgsapplayertreeviewmenuprovider.cpp
Expand Up @@ -50,6 +50,7 @@
#include "qgsvectorlayer.h"
#include "qgsvectorlayerlabeling.h"
#include "qgsxmlutils.h"
#include "qgsmeshlayer.h"


QgsAppLayerTreeViewMenuProvider::QgsAppLayerTreeViewMenuProvider( QgsLayerTreeView *view, QgsMapCanvas *canvas )
Expand Down Expand Up @@ -153,6 +154,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
QgsRasterLayer *rlayer = qobject_cast<QgsRasterLayer *>( layer );
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
QgsPointCloudLayer *pcLayer = qobject_cast<QgsPointCloudLayer * >( layer );
QgsMeshLayer *meshLayer = qobject_cast<QgsMeshLayer * >( layer );

if ( layer && layer->isSpatial() )
{
Expand Down Expand Up @@ -363,8 +365,8 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
menu->addAction( tr( "&Filter…" ), QgisApp::instance(), qOverload<>( &QgisApp::layerSubsetString ) );
}

// change data source is only supported for vectors and rasters, point clouds
if ( vlayer || rlayer || pcLayer )
// change data source is only supported for vectors, rasters, point clouds, mesh
if ( vlayer || rlayer || pcLayer || meshLayer )
{

QAction *a = new QAction( layer->isValid() ? tr( "C&hange Data Source…" ) : tr( "Repair Data Source…" ), menu );
Expand Down

0 comments on commit 16200ca

Please sign in to comment.