Skip to content
Permalink
Browse files

fix per review from @nyalldawson

  • Loading branch information
Samweli authored and nyalldawson committed Jan 13, 2020
1 parent 6a52302 commit 8146cc3c5f59f446620d1dd1ad196e5f8f7be2b6
Showing with 2 additions and 4 deletions.
  1. +2 −4 src/providers/wms/qgswmsdataitems.cpp
@@ -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 );
@@ -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;

0 comments on commit 8146cc3

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