Skip to content

Commit

Permalink
Fix QgsMapLayer ConvertToSubClassCode (#3611)
Browse files Browse the repository at this point in the history
Fix #15683
  • Loading branch information
m-kuhn authored Oct 17, 2016
1 parent 8fa3127 commit 03f08a6
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions python/core/qgsmaplayer.sip
Original file line number Diff line number Diff line change
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 03f08a6

Please sign in to comment.