Skip to content

Commit

Permalink
Fix missing bad layer indicator for point cloud/mesh layers
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 26, 2020
1 parent 29a60df commit bf00846
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/app/qgslayertreeviewindicatorprovider.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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() )
Expand All @@ -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 );
Expand Down

0 comments on commit bf00846

Please sign in to comment.