Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix QgsMapLayer ConvertToSubClassCode (#3611)
Fix #15683
  • Loading branch information
m-kuhn committed Oct 18, 2016
1 parent 2b033c1 commit 73afe21
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions python/core/qgsmaplayer.sip
Expand Up @@ -10,10 +10,12 @@ class QgsMapLayer : QObject
%End

%ConvertToSubClassCode
if (sipCpp->inherits("QgsMapLayer"))
QgsMapLayer* layer = qobject_cast<QgsMapLayer*>( sipCpp );

sipType = 0;

if ( layer )
{
sipType = sipType_QgsMapLayer;
QgsMapLayer* layer = qobject_cast<QgsMapLayer*>(sipCpp);
if (layer->type() == QgsMapLayer::VectorLayer)
{
sipType = sipType_QgsVectorLayer;
Expand All @@ -27,11 +29,6 @@ class QgsMapLayer : QObject
sipType = sipType_QgsPluginLayer;
}
}
else
{
sipType = 0;
}

%End

public:
Expand Down

0 comments on commit 73afe21

Please sign in to comment.