File tree 1 file changed +14
-3
lines changed
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -3497,9 +3497,19 @@ namespace QgsWms
3497
3497
QStringList _result;
3498
3498
if ( mLayerGroups .contains ( name ) )
3499
3499
{
3500
- for ( const auto &l : mLayerGroups [ name ] )
3500
+ const auto &layers { mLayerGroups [ name ] };
3501
+ for ( const auto &l : layers )
3501
3502
{
3502
- _result.append ( findLeaves ( l->shortName ().isEmpty () ? l->name () : l->shortName () ) );
3503
+ const auto nick { layerNickname ( *l ) };
3504
+ // This handles the case for root (fake) group
3505
+ if ( mLayerGroups .contains ( nick ) )
3506
+ {
3507
+ _result.append ( name );
3508
+ }
3509
+ else
3510
+ {
3511
+ _result.append ( findLeaves ( nick ) );
3512
+ }
3503
3513
}
3504
3514
}
3505
3515
else
@@ -3508,7 +3518,8 @@ namespace QgsWms
3508
3518
}
3509
3519
return _result;
3510
3520
};
3511
- for ( const auto &name : mWmsParameters .queryLayersNickname () )
3521
+ const auto constNicks { mWmsParameters .queryLayersNickname () };
3522
+ for ( const auto &name : constNicks )
3512
3523
{
3513
3524
result.append ( findLeaves ( name ) );
3514
3525
}
You can’t perform that action at this time.
0 commit comments