Skip to content
Permalink
Browse files

Use a switch

  • Loading branch information
nyalldawson committed Oct 16, 2018
1 parent 72bf08e commit 3543d34dea76e39d54f862d80b8fa61e3b31d08c
Showing with 23 additions and 7 deletions.
  1. +23 −7 src/core/qgsdataitem.cpp
@@ -611,13 +611,29 @@ QgsLayerItem::QgsLayerItem( QgsDataItem *parent, const QString &name, const QStr

QgsMapLayer::LayerType QgsLayerItem::mapLayerType() const
{
if ( mLayerType == QgsLayerItem::Raster )
return QgsMapLayer::RasterLayer;
if ( mLayerType == QgsLayerItem::Mesh )
return QgsMapLayer::MeshLayer;
if ( mLayerType == QgsLayerItem::Plugin )
return QgsMapLayer::PluginLayer;
return QgsMapLayer::VectorLayer;
switch ( mLayerType )
{
case QgsLayerItem::Raster:
return QgsMapLayer::RasterLayer;

case QgsLayerItem::Mesh:
return QgsMapLayer::MeshLayer;

case QgsLayerItem::Plugin:
return QgsMapLayer::PluginLayer;

case QgsLayerItem::NoType:
case QgsLayerItem::Vector:
case QgsLayerItem::Point:
case QgsLayerItem::Polygon:
case QgsLayerItem::Line:
case QgsLayerItem::TableLayer:
case QgsLayerItem::Table:
case QgsLayerItem::Database:
return QgsMapLayer::VectorLayer;
}

return QgsMapLayer::VectorLayer; // no warnings
}

QString QgsLayerItem::layerTypeAsString( QgsLayerItem::LayerType layerType )

0 comments on commit 3543d34

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