Skip to content

Commit

Permalink
Fix addGroup() not to refuse invisibleRootItem as the group parent
Browse files Browse the repository at this point in the history
Fixes #6879.
NOTE: if a caller really wants to add a group to current item
      there's a specific method for that: addGroupToCurrentItem
  • Loading branch information
Sandro Santilli committed Dec 17, 2012
1 parent 76115ec commit 122cff7
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/app/legend/qgslegend.cpp
Expand Up @@ -212,12 +212,7 @@ int QgsLegend::addGroup( QString name, bool expand, QTreeWidgetItem* parent )
{
if ( nameEmpty )
name = getUniqueGroupName( tr( "group" ), groups() );
group = new QgsLegendGroup( this, name );

if ( currentItem() )
{
moveItem( group, currentItem() );
}
group = new QgsLegendGroup( parent, name );
}

QModelIndex groupIndex = indexFromItem( group );
Expand Down

0 comments on commit 122cff7

Please sign in to comment.