Skip to content
Permalink
Browse files
Remove duplicate code
  • Loading branch information
nyalldawson committed Sep 6, 2021
1 parent 77729d1 commit 13b6cbcbdc2c68f9f4431c4b5d278bba05d2e889
Showing with 1 addition and 48 deletions.
  1. +1 −48 src/core/layertree/qgslayertreemodel.cpp
@@ -199,54 +199,7 @@ QVariant QgsLayerTreeModel::data( const QModelIndex &index, int role ) const
return QVariant();

// icons possibly overriding default icon
QIcon icon;

switch ( layer->type() )
{
case QgsMapLayerType::RasterLayer:
icon = QgsIconUtils::iconRaster();
break;

case QgsMapLayerType::MeshLayer:
icon = QgsIconUtils::iconMesh();
break;

case QgsMapLayerType::VectorTileLayer:
icon = QgsIconUtils::iconVectorTile();
break;

case QgsMapLayerType::PointCloudLayer:
icon = QgsIconUtils::iconPointCloud();
break;

case QgsMapLayerType::VectorLayer:
{
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
switch ( vlayer->geometryType() )
{
case QgsWkbTypes::PointGeometry:
icon = QgsIconUtils::iconPoint();
break;
case QgsWkbTypes::LineGeometry:
icon = QgsIconUtils::iconLine();
break;
case QgsWkbTypes::PolygonGeometry:
icon = QgsIconUtils::iconPolygon();
break;
case QgsWkbTypes::UnknownGeometry:
icon = QgsIconUtils::iconGeometryCollection();
break;
case QgsWkbTypes::NullGeometry:
icon = QgsIconUtils::iconTable();
break;
}
break;
}

case QgsMapLayerType::PluginLayer:
case QgsMapLayerType::AnnotationLayer:
break;
}
QIcon icon = QgsIconUtils::iconForLayer( layer );

// if there's just on legend entry that should be embedded in layer - do that!
if ( testFlag( ShowLegend ) && legendEmbeddedInParent( nodeLayer ) )

0 comments on commit 13b6cbc

Please sign in to comment.