Skip to content
Permalink
Browse files

Correctly parse styles for layer in groups

  • Loading branch information
elpaso committed Nov 6, 2018
1 parent 39e0b7b commit 6e85a893ea7bd2edfdc9e66e7e2e7c55a66da400
Showing with 15 additions and 1 deletion.
  1. +15 −1 src/core/layertree/qgslayertreeutils.cpp
@@ -311,7 +311,8 @@ void QgsLayerTreeUtils::storeOriginalLayersProperties( QgsLayerTreeGroup *group,
const QDomNodeList mlNodeList( doc->documentElement()
.firstChildElement( QStringLiteral( "projectlayers" ) )
.elementsByTagName( QStringLiteral( "maplayer" ) ) );
for ( QgsLayerTreeNode *node : group->children() )

std::function<void ( QgsLayerTreeNode * )> _store = [ & ]( QgsLayerTreeNode * node )
{
if ( QgsLayerTree::isLayer( node ) )
{
@@ -337,6 +338,19 @@ void QgsLayerTreeUtils::storeOriginalLayersProperties( QgsLayerTreeGroup *group,
}
}
}
else if ( QgsLayerTree::isGroup( node ) )
{
const QList<QgsLayerTreeNode *> constChildren( node->children( ) );
for ( const auto &childNode : constChildren )
{
_store( childNode );
}
}
};

for ( QgsLayerTreeNode *node : group->children() )
{
_store( node );
}
}

0 comments on commit 6e85a89

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