Skip to content
Permalink
Browse files

follow p 6377303 avoid type check before casting

  • Loading branch information
3nids committed Dec 15, 2016
1 parent 417a5cd commit 86afa4e3540acb31328a01141e6d54481e5f8f42
Showing with 2 additions and 7 deletions.
  1. +2 −7 src/app/qgssnappinglayertreemodel.cpp
@@ -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

0 comments on commit 86afa4e

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