Skip to content

Commit

Permalink
follow p 6377303 avoid type check before casting
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Dec 15, 2016
1 parent 417a5cd commit 86afa4e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/app/qgssnappinglayertreemodel.cpp
Expand Up @@ -319,14 +319,9 @@ bool QgsSnappingLayerTreeModel::nodeShown( QgsLayerTreeNode* node ) const
}
else
{
QgsMapLayer* layer = QgsLayerTree::toLayer( node )->layer();
if ( layer && layer->type() == QgsMapLayer::VectorLayer )
{
QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>( layer );
return vl && vl->hasGeometryType();
}
QgsVectorLayer* layer = qobject_cast<QgsVectorLayer*>( QgsLayerTree::toLayer( node )->layer() );
return layer && layer->hasGeometryType();
}
return false;
}

QVariant QgsSnappingLayerTreeModel::headerData( int section, Qt::Orientation orientation, int role ) const
Expand Down

0 comments on commit 86afa4e

Please sign in to comment.