Skip to content
Permalink
Browse files

Fix for layer order in case of option addNewLayersToCurrentGroup

  • Loading branch information
Marco Hugentobler authored and mhugent committed Jun 8, 2011
1 parent 2ab3813 commit ebfef6ff1952c38170ace538d1e1a1b2f6458460
Showing with 11 additions and 2 deletions.
  1. +11 −2 src/app/legend/qgslegend.cpp
@@ -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 );
}
}

0 comments on commit ebfef6f

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