Skip to content

Commit

Permalink
followup r12593
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@12594 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Dec 23, 2009
1 parent 79ced39 commit 2355aa8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
17 changes: 1 addition & 16 deletions src/app/legend/qgslegend.cpp
Expand Up @@ -504,9 +504,6 @@ void QgsLegend::addLayer( QgsMapLayer * layer )

QgsLegendLayer* llayer = new QgsLegendLayer( layer );

llayer->updateIcon();
llayer->setToolTip( 0, layer->publicSource() );

//set the correct check states
blockSignals( true );
if ( llayer->isVisible() )
Expand Down Expand Up @@ -1045,20 +1042,8 @@ QgsLegendLayer* QgsLegend::readLayerFromXML( QDomElement& childelem, bool& isOpe
// load layer's visibility and 'show in overview' flag
ll->setInOverview( atoi( fileElem.attribute( "isInOverview" ).toUtf8() ) );

//set the layer type icon
ll->updateIcon();
ll->setToolTip( 0, theMapLayer->publicSource() );

// setup connections that will update the layer icons
if ( qobject_cast<QgsVectorLayer *>( theMapLayer ) )
{
QgsDebugMsg( "Connecting signals for updating icons, layer " + theMapLayer->name() );
connect( theMapLayer, SIGNAL( editingStarted() ), ll, SLOT( updateIcon() ) );
connect( theMapLayer, SIGNAL( editingStopped() ), ll, SLOT( updateIcon() ) );
}

// expanded or collapsed
isOpen = ( childelem.attribute( "open" ) == "true" );
isOpen = childelem.attribute( "open" ) == "true";

//set the checkbox of the legend layer to the right state
blockSignals( true );
Expand Down
3 changes: 3 additions & 0 deletions src/app/legend/qgslegendlayer.cpp
Expand Up @@ -85,6 +85,9 @@ QgsLegendLayer::QgsLegendLayer( QgsMapLayer* layer )
connect( layer, SIGNAL( editingStopped() ), this, SLOT( updateIcon() ) );
}
connect( layer, SIGNAL( layerNameChanged() ), this, SLOT( layerNameChanged() ) );

updateIcon();
setToolTip( 0, layer->publicSource() );
}

QgsLegendLayer::~QgsLegendLayer()
Expand Down

0 comments on commit 2355aa8

Please sign in to comment.