mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-12 00:02:25 -04:00
fix per review from @nyalldawson
This commit is contained in:
parent
6a52302853
commit
8146cc3c5f
@ -96,7 +96,7 @@ QVector<QgsDataItem *> QgsWMSConnectionItem::createChildren()
|
|||||||
// Attention, the name may be empty
|
// Attention, the name may be empty
|
||||||
QgsDebugMsgLevel( QString::number( layerProperty.orderId ) + ' ' + layerProperty.name + ' ' + layerProperty.title, 2 );
|
QgsDebugMsgLevel( QString::number( layerProperty.orderId ) + ' ' + layerProperty.name + ' ' + layerProperty.title, 2 );
|
||||||
QString pathName = layerProperty.name.isEmpty() ? QString::number( layerProperty.orderId ) : layerProperty.name;
|
QString pathName = layerProperty.name.isEmpty() ? QString::number( layerProperty.orderId ) : layerProperty.name;
|
||||||
QgsDataItem *layer;
|
QgsDataItem *layer = nullptr;
|
||||||
|
|
||||||
if ( layerProperty.name.isEmpty() )
|
if ( layerProperty.name.isEmpty() )
|
||||||
layer = new QgsWMSLayerCollectionItem( this, layerProperty.title, mPath + '/' + pathName, capabilitiesProperty, uri, layerProperty );
|
layer = new QgsWMSLayerCollectionItem( this, layerProperty.title, mPath + '/' + pathName, capabilitiesProperty, uri, layerProperty );
|
||||||
@ -266,15 +266,13 @@ bool QgsWMSLayerCollectionItem::equal( const QgsDataItem *other )
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const QgsWMSLayerCollectionItem *otherCollectionItem = dynamic_cast<const QgsWMSLayerCollectionItem *>( other );
|
const QgsWMSLayerCollectionItem *otherCollectionItem = qobject_cast<const QgsWMSLayerCollectionItem *>( other );
|
||||||
if ( !otherCollectionItem )
|
if ( !otherCollectionItem )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the children are not the same then they are not equal
|
// 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() )
|
if ( mChildren.size() != otherCollectionItem->mChildren.size() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user