Skip to content
Permalink
Browse files

Fix missing bad layer indicator for point cloud/mesh layers

  • Loading branch information
nyalldawson committed Oct 26, 2020
1 parent 29a60df commit bf008463572ea8b58b2d5d62ee834874d188d278
Showing with 12 additions and 3 deletions.
  1. +12 −3 src/app/qgslayertreeviewindicatorprovider.cpp
@@ -21,6 +21,7 @@
#include "qgslayertreeview.h"
#include "qgsvectorlayer.h"
#include "qgsrasterlayer.h"
#include "qgspointcloudlayer.h"
#include "qgsmeshlayer.h"
#include "qgisapp.h"
#include "qgsapplication.h"
@@ -99,7 +100,8 @@ void QgsLayerTreeViewIndicatorProvider::onLayerLoaded()

if ( !( qobject_cast<QgsVectorLayer *>( layerNode->layer() ) ||
qobject_cast<QgsRasterLayer *>( layerNode->layer() ) ||
qobject_cast<QgsMeshLayer *>( layerNode->layer() ) ) )
qobject_cast<QgsMeshLayer *>( layerNode->layer() ) ||
qobject_cast<QgsPointCloudLayer *>( layerNode->layer() ) ) )
return;

if ( QgsMapLayer *mapLayer = layerNode->layer() )
@@ -123,15 +125,22 @@ void QgsLayerTreeViewIndicatorProvider::onLayerChanged()

void QgsLayerTreeViewIndicatorProvider::connectSignals( QgsMapLayer *layer )
{
if ( !( qobject_cast<QgsVectorLayer *>( layer ) || qobject_cast<QgsRasterLayer *>( layer ) ) )
if ( !( qobject_cast<QgsVectorLayer *>( layer )
|| qobject_cast<QgsRasterLayer *>( layer )
|| qobject_cast<QgsMeshLayer *>( layer )
|| qobject_cast<QgsPointCloudLayer *>( layer ) ) )
return;

QgsMapLayer *mapLayer = layer;
connect( mapLayer, &QgsMapLayer::dataSourceChanged, this, &QgsLayerTreeViewIndicatorProvider::onLayerChanged );
}

void QgsLayerTreeViewIndicatorProvider::disconnectSignals( QgsMapLayer *layer )
{
if ( !( qobject_cast<QgsVectorLayer *>( layer ) || qobject_cast<QgsRasterLayer *>( layer ) ) )
if ( !( qobject_cast<QgsVectorLayer *>( layer )
|| qobject_cast<QgsRasterLayer *>( layer )
|| qobject_cast<QgsMeshLayer *>( layer )
|| qobject_cast<QgsPointCloudLayer *>( layer ) ) )
return;
QgsMapLayer *mapLayer = layer;
disconnect( mapLayer, &QgsMapLayer::dataSourceChanged, this, &QgsLayerTreeViewIndicatorProvider::onLayerChanged );

0 comments on commit bf00846

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