Skip to content

Commit

Permalink
Fix expanded/collapsed state when loading layer tree from old project…
Browse files Browse the repository at this point in the history
… files
  • Loading branch information
wonder-sk committed Jun 13, 2014
1 parent eb86eca commit 9af0b37
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/layertree/qgslayertreeutils.cpp
Expand Up @@ -204,7 +204,6 @@ static void _readOldLegendGroup( const QDomElement& groupElem, QgsLayerTreeGroup
QDomNodeList groupChildren = groupElem.childNodes();

QgsLayerTreeGroup* groupNode = new QgsLayerTreeGroup( groupElem.attribute( "name" ) );
parent->addChildNode( groupNode );

groupNode->setVisible( QgsLayerTreeUtils::checkStateFromXml( groupElem.attribute( "checked" ) ) );
groupNode->setExpanded( groupElem.attribute( "open" ) == "true" );
Expand All @@ -227,6 +226,8 @@ static void _readOldLegendGroup( const QDomElement& groupElem, QgsLayerTreeGroup
_readOldLegendGroup( currentChildElem, groupNode );
}
}

parent->addChildNode( groupNode );
}

static void _readOldLegendLayer( const QDomElement& layerElem, QgsLayerTreeGroup* parent )
Expand Down

0 comments on commit 9af0b37

Please sign in to comment.