Skip to content

Commit

Permalink
Fix for layer order in case of option addNewLayersToCurrentGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Hugentobler authored and mhugent committed Jun 8, 2011
1 parent 2ab3813 commit ebfef6f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/app/legend/qgslegend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,10 +698,19 @@ QgsLegendGroup* QgsLegend::addEmbeddedGroup( const QString& groupName, const QSt
{
QString layerId = childElem.firstChildElement( "filegroup" ).firstChildElement( "legendlayerfile" ).attribute( "layerid" );
QgsProject::instance()->createEmbeddedLayer( layerId, projectFilePath, brokenNodes, vectorLayerList, false );
QTreeWidgetItem* cItem = currentItem();
if ( cItem && cItem != group )
QTreeWidgetItem* cItem = 0;
if( settings.value("/qgis/addNewLayersToCurrentGroup", false ).toBool() )
{
cItem = group->takeChild( 0 );
}
else
{
cItem = currentItem();
removeItem( cItem );
}

if( cItem )
{
group->insertChild( group->childCount(), cItem );
}
}
Expand Down

0 comments on commit ebfef6f

Please sign in to comment.