Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix #11143 (cannot remove visibility group) take two
  • Loading branch information
wonder-sk committed Sep 8, 2014
1 parent a4c8c51 commit c04127e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/qgsvisibilitygroups.cpp
Expand Up @@ -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" );
}

Expand All @@ -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" );
}

Expand Down

0 comments on commit c04127e

Please sign in to comment.