Skip to content

Commit

Permalink
added documentation on new wms layer class
Browse files Browse the repository at this point in the history
  • Loading branch information
Samweli authored and nyalldawson committed Jan 18, 2020
1 parent 91604f1 commit bc0b427
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/providers/wms/qgswmsdataitems.cpp
Expand Up @@ -251,8 +251,12 @@ QgsWMSLayerCollectionItem::QgsWMSLayerCollectionItem( QgsDataItem *parent, QStri
// 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;
QgsWMSLayerItem *layer = new QgsWMSLayerItem( this, layerProperty.title, mPath + '/' + pathName, mCapabilitiesProperty, dataSourceUri, layerProperty );
//mChildren.append( layer );

if ( layerProperty.name.isEmpty() )
layer = new QgsWMSLayerCollectionItem( this, layerProperty.title, mPath + '/' + pathName, capabilitiesProperty, dataSourceUri, layerProperty );
else
layer = new QgsWMSLayerItem( this, layerProperty.title, mPath + '/' + pathName, mCapabilitiesProperty, dataSourceUri, layerProperty );

addChildItem( layer );
}

Expand Down
10 changes: 10 additions & 0 deletions src/providers/wms/qgswmsdataitems.h
Expand Up @@ -41,6 +41,11 @@ class QgsWMSConnectionItem : public QgsDataCollectionItem
QgsWmsCapabilitiesDownload *mCapabilitiesDownload = nullptr;
};

/**
* \brief WMS Layer Collection.
*
* This collection contains a WMS Layer element that can enclose other layers
*/
class QgsWMSLayerCollectionItem : public QgsDataCollectionItem
{
Q_OBJECT
Expand All @@ -52,8 +57,13 @@ class QgsWMSLayerCollectionItem : public QgsDataCollectionItem

bool equal( const QgsDataItem *other ) override;

//! Stores GetCapabilities response
QgsWmsCapabilitiesProperty mCapabilitiesProperty;

//! Stores WMS connection information
QgsDataSourceUri mDataSourceUri;

//! WMS Layer properties, can be inherited by subsidiary layers
QgsWmsLayerProperty mLayerProperty;
};

Expand Down

0 comments on commit bc0b427

Please sign in to comment.