Skip to content

Commit

Permalink
Avoid unnecessary canvas refreshes when adding group to legend
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jun 7, 2011
1 parent aabfbf8 commit 9d4a9cc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/legend/qgslegend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ int QgsLegend::addGroupToCurrentItem( QString name, bool expand )

int QgsLegend::addGroup( QString name, bool expand, QTreeWidgetItem* parent )
{
//avoid multiple refreshes of map canvas because of itemChanged signal
blockSignals( true );

bool nameEmpty = name.isEmpty();
if ( nameEmpty )
name = tr( "group" ); // some default name if none specified
Expand All @@ -174,6 +177,7 @@ int QgsLegend::addGroup( QString name, bool expand, QTreeWidgetItem* parent )
if ( nameEmpty )
openEditor();

blockSignals( false );
return groupIndex.row();
}

Expand Down

0 comments on commit 9d4a9cc

Please sign in to comment.