Skip to content
Permalink
Browse files

Cleanup QgsVectorLayer::geometryType()

The method QgsVectorLayer::wkbType() already uses a member variable which is a copy
of the one on the data provider. By using this, the code becomes simpler and more
consistent.

(cherry picked from commit bc6a9c5)
  • Loading branch information
m-kuhn authored and nyalldawson committed Mar 1, 2019
1 parent bae156e commit 6e1b91f6967f117142f0d0c4950b0f0c7302baeb
Showing with 1 addition and 10 deletions.
  1. +1 −10 src/core/qgsvectorlayer.cpp
@@ -588,16 +588,7 @@ void QgsVectorLayer::setDiagramRenderer( QgsDiagramRenderer *r )

QgsWkbTypes::GeometryType QgsVectorLayer::geometryType() const
{
if ( mValid && mDataProvider )
{
return QgsWkbTypes::geometryType( mDataProvider->wkbType() );
}
else
{
QgsDebugMsgLevel( QStringLiteral( "invalid layer or pointer to mDataProvider is null" ), 3 );
}
QgsDebugMsgLevel( QStringLiteral( "Vector layer with unknown geometry type." ), 3 );
return QgsWkbTypes::UnknownGeometry;
return QgsWkbTypes::geometryType( mWkbType );
}

QgsWkbTypes::Type QgsVectorLayer::wkbType() const

0 comments on commit 6e1b91f

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