Skip to content

Commit e80b74e

Browse files
author
jef
committedDec 23, 2009

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed
 

‎src/app/legend/qgslegend.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,6 @@ void QgsLegend::addLayer( QgsMapLayer * layer )
504504

505505
QgsLegendLayer* llayer = new QgsLegendLayer( layer );
506506

507-
llayer->updateIcon();
508-
llayer->setToolTip( 0, layer->publicSource() );
509-
510507
//set the correct check states
511508
blockSignals( true );
512509
if ( llayer->isVisible() )
@@ -1045,20 +1042,8 @@ QgsLegendLayer* QgsLegend::readLayerFromXML( QDomElement& childelem, bool& isOpe
10451042
// load layer's visibility and 'show in overview' flag
10461043
ll->setInOverview( atoi( fileElem.attribute( "isInOverview" ).toUtf8() ) );
10471044

1048-
//set the layer type icon
1049-
ll->updateIcon();
1050-
ll->setToolTip( 0, theMapLayer->publicSource() );
1051-
1052-
// setup connections that will update the layer icons
1053-
if ( qobject_cast<QgsVectorLayer *>( theMapLayer ) )
1054-
{
1055-
QgsDebugMsg( "Connecting signals for updating icons, layer " + theMapLayer->name() );
1056-
connect( theMapLayer, SIGNAL( editingStarted() ), ll, SLOT( updateIcon() ) );
1057-
connect( theMapLayer, SIGNAL( editingStopped() ), ll, SLOT( updateIcon() ) );
1058-
}
1059-
10601045
// expanded or collapsed
1061-
isOpen = ( childelem.attribute( "open" ) == "true" );
1046+
isOpen = childelem.attribute( "open" ) == "true";
10621047

10631048
//set the checkbox of the legend layer to the right state
10641049
blockSignals( true );

‎src/app/legend/qgslegendlayer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ QgsLegendLayer::QgsLegendLayer( QgsMapLayer* layer )
8585
connect( layer, SIGNAL( editingStopped() ), this, SLOT( updateIcon() ) );
8686
}
8787
connect( layer, SIGNAL( layerNameChanged() ), this, SLOT( layerNameChanged() ) );
88+
89+
updateIcon();
90+
setToolTip( 0, layer->publicSource() );
8891
}
8992

9093
QgsLegendLayer::~QgsLegendLayer()

0 commit comments

Comments
 (0)
Please sign in to comment.