Skip to content
Permalink
Browse files

Fix #11143 (cannot remove visibility group) take two

  • Loading branch information
wonder-sk committed Sep 8, 2014
1 parent a4c8c51 commit c04127eccd2b6d32b66dff4222eedab2756e0386
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/app/qgsvisibilitygroups.cpp
@@ -314,7 +314,9 @@ void QgsVisibilityGroups::readProject( const QDomDocument& doc )
QDomElement visGroupLayerElem = visGroupElem.firstChildElement( "layer" );
while ( !visGroupLayerElem.isNull() )
{
rec.mVisibleLayerIDs << visGroupLayerElem.attribute( "id" );
QString layerID = visGroupLayerElem.attribute( "id" );
if ( QgsMapLayerRegistry::instance()->mapLayer( layerID ) )
rec.mVisibleLayerIDs << layerID; // only use valid layer IDs
visGroupLayerElem = visGroupLayerElem.nextSiblingElement( "layer" );
}

@@ -330,7 +332,9 @@ void QgsVisibilityGroups::readProject( const QDomDocument& doc )
checkedLegendNodeElem = checkedLegendNodeElem.nextSiblingElement( "checked-legend-node" );
}

rec.mPerLayerCheckedLegendSymbols.insert( checkedLegendNodesElem.attribute( "id" ), checkedLegendNodes );
QString layerID = checkedLegendNodesElem.attribute( "id" );
if ( QgsMapLayerRegistry::instance()->mapLayer( layerID ) ) // only use valid IDs
rec.mPerLayerCheckedLegendSymbols.insert( layerID, checkedLegendNodes );
checkedLegendNodesElem = checkedLegendNodesElem.nextSiblingElement( "checked-legend-nodes" );
}

0 comments on commit c04127e

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