Skip to content

Commit

Permalink
fix per review from @nyalldawson
Browse files Browse the repository at this point in the history
  • Loading branch information
Samweli authored and nyalldawson committed Jan 18, 2020
1 parent 6a52302 commit 8146cc3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/providers/wms/qgswmsdataitems.cpp
Expand Up @@ -96,7 +96,7 @@ QVector<QgsDataItem *> QgsWMSConnectionItem::createChildren()
// Attention, the name may be empty
QgsDebugMsgLevel( QString::number( layerProperty.orderId ) + ' ' + layerProperty.name + ' ' + layerProperty.title, 2 );
QString pathName = layerProperty.name.isEmpty() ? QString::number( layerProperty.orderId ) : layerProperty.name;
QgsDataItem *layer;
QgsDataItem *layer = nullptr;

if ( layerProperty.name.isEmpty() )
layer = new QgsWMSLayerCollectionItem( this, layerProperty.title, mPath + '/' + pathName, capabilitiesProperty, uri, layerProperty );
Expand Down Expand Up @@ -266,15 +266,13 @@ bool QgsWMSLayerCollectionItem::equal( const QgsDataItem *other )
{
return false;
}
const QgsWMSLayerCollectionItem *otherCollectionItem = dynamic_cast<const QgsWMSLayerCollectionItem *>( other );
const QgsWMSLayerCollectionItem *otherCollectionItem = qobject_cast<const QgsWMSLayerCollectionItem *>( other );
if ( !otherCollectionItem )
{
return false;
}

// Check if the children are not the same then they are not equal
if ( mChildren.isEmpty() & !otherCollectionItem->mChildren.isEmpty() )
return false;
if ( mChildren.size() != otherCollectionItem->mChildren.size() )
return false;

Expand Down

0 comments on commit 8146cc3

Please sign in to comment.