File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -284,6 +284,7 @@ bool QgsWMSSourceSelect::populateLayerList( const QgsWmsCapabilities &capabiliti
284284 QVector<QgsWmsLayerProperty> layers = capabilities.supportedLayers ();
285285
286286 bool first = true ;
287+ QSet<QString> alreadyAddedLabels;
287288 Q_FOREACH ( const QString &encoding, capabilities.supportedImageEncodings () )
288289 {
289290 int id = mMimeMap .value ( encoding, -1 );
@@ -292,6 +293,13 @@ bool QgsWMSSourceSelect::populateLayerList( const QgsWmsCapabilities &capabiliti
292293 QgsDebugMsg ( QString ( " encoding %1 not supported." ).arg ( encoding ) );
293294 continue ;
294295 }
296+ // Different mime-types can map to the same label. Just add the first
297+ // match to avoid duplicates in the UI
298+ if ( alreadyAddedLabels.contains ( mFormats [id].label ) )
299+ {
300+ continue ;
301+ }
302+ alreadyAddedLabels.insert ( mFormats [id].label );
295303
296304 mImageFormatGroup ->button ( id )->setVisible ( true );
297305 if ( first )
You can’t perform that action at this time.
0 commit comments