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 9, 2011
1 parent f562810 commit 1b15528
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/app/legend/qgslegend.cpp
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 1b15528

Please sign in to comment.