Skip to content
Permalink
Browse files

[WMS provider] Avoid duplicate format selection radio buttons (fixes #…

  • Loading branch information
rouault committed May 23, 2018
1 parent 839de2e commit ce72bde32a5f5985e45eec9f71b33d2992ea0484
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/providers/wms/qgswmssourceselect.cpp
@@ -284,6 +284,7 @@ bool QgsWMSSourceSelect::populateLayerList( const QgsWmsCapabilities &capabiliti
QVector<QgsWmsLayerProperty> layers = capabilities.supportedLayers();

bool first = true;
QSet<QString> alreadyAddedLabels;
Q_FOREACH ( const QString &encoding, capabilities.supportedImageEncodings() )
{
int id = mMimeMap.value( encoding, -1 );
@@ -292,6 +293,13 @@ bool QgsWMSSourceSelect::populateLayerList( const QgsWmsCapabilities &capabiliti
QgsDebugMsg( QString( "encoding %1 not supported." ).arg( encoding ) );
continue;
}
// Different mime-types can map to the same label. Just add the first
// match to avoid duplicates in the UI
if ( alreadyAddedLabels.contains( mFormats[id].label ) )
{
continue;
}
alreadyAddedLabels.insert( mFormats[id].label );

mImageFormatGroup->button( id )->setVisible( true );
if ( first )

0 comments on commit ce72bde

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