Skip to content
Permalink
Browse files
Revert renaming of main layer-tree-group node
  • Loading branch information
m-kuhn committed Mar 23, 2017
1 parent e5aacea commit 1ffa9ee7a6e48e03e1c4876566f062b3b1e4b0b5
@@ -114,7 +114,7 @@ QgsLayerTree *QgsLayerTree::readXml( QDomElement &element )
void QgsLayerTree::writeXml( QDomElement &parentElement )
{
QDomDocument doc = parentElement.ownerDocument();
QDomElement elem = doc.createElement( QStringLiteral( "layer-tree" ) );
QDomElement elem = doc.createElement( QStringLiteral( "layer-tree-group" ) );

writeCommonXml( elem );

@@ -193,7 +193,6 @@ QList<QgsMapLayer *> QgsMapThemeCollection::masterVisibleLayers() const
// no project layer order set
return visibleLayers;
}

else
{
QList< QgsMapLayer * > orderedVisibleLayers;
@@ -846,23 +846,14 @@ bool QgsProject::read()

mRootGroup->setCustomProperty( QStringLiteral( "loading" ), 1 );

QDomElement layerTreeElem = doc->documentElement().firstChildElement( QStringLiteral( "layer-tree" ) );
QDomElement layerTreeElem = doc->documentElement().firstChildElement( QStringLiteral( "layer-tree-group" ) );
if ( !layerTreeElem.isNull() )
{
// read the tree but do not resolve the references (we have not loaded the layers yet)
mRootGroup->readChildrenFromXml( layerTreeElem );
}
else
{
QDomElement layerTreeGroupElem = doc->documentElement().firstChildElement( QStringLiteral( "layer-tree-group" ) );
if ( !layerTreeGroupElem.isNull() )
{
mRootGroup->readChildrenFromXml( layerTreeGroupElem );
}
else
{
QgsLayerTreeUtils::readOldLegend( mRootGroup, doc->documentElement().firstChildElement( QStringLiteral( "legend" ) ) );
}
QgsLayerTreeUtils::readOldLegend( mRootGroup, doc->documentElement().firstChildElement( QStringLiteral( "legend" ) ) );
}

mLayerTreeRegistryBridge->setEnabled( false );
@@ -202,8 +202,8 @@ def test_layerDefinitionRewriteId(self):
newPointsLayer = l.layer()
elif l.layerId().startswith('lines'):
newLinesLayer = l.layer()
self.assertFalse(newPointsLayer is None)
self.assertFalse(newLinesLayer is None)
self.assertIsNotNone(newPointsLayer)
self.assertIsNotNone(newLinesLayer)
self.assertTrue(newLinesLayer.id() in [dep.layerId() for dep in newPointsLayer.dependencies()])

self.pointsLayer.setDependencies([])

0 comments on commit 1ffa9ee

Please sign in to comment.