Skip to content
Permalink
Browse files

Fix for layer order in case of option addNewLayersToCurrentGroup

  • Loading branch information
Marco Hugentobler
Marco Hugentobler committed Jun 8, 2011
1 parent 9d4a9cc commit dac39eb5dae7ae99ce2341dd29b01031077f22cf
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 dac39eb

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