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
284
284
QVector<QgsWmsLayerProperty> layers = capabilities.supportedLayers ();
285
285
286
286
bool first = true ;
287
+ QSet<QString> alreadyAddedLabels;
287
288
Q_FOREACH ( const QString &encoding, capabilities.supportedImageEncodings () )
288
289
{
289
290
int id = mMimeMap .value ( encoding, -1 );
@@ -292,6 +293,13 @@ bool QgsWMSSourceSelect::populateLayerList( const QgsWmsCapabilities &capabiliti
292
293
QgsDebugMsg ( QString ( " encoding %1 not supported." ).arg ( encoding ) );
293
294
continue ;
294
295
}
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 );
295
303
296
304
mImageFormatGroup ->button ( id )->setVisible ( true );
297
305
if ( first )
You can’t perform that action at this time.
0 commit comments