Skip to content

Commit

Permalink
Adding connection of signals when reading legend layers from project …
Browse files Browse the repository at this point in the history
…XML file. Fixes #1760

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11405 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
homann committed Aug 17, 2009
1 parent 61f4676 commit b730994
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/app/legend/qgslegend.cpp
Expand Up @@ -616,11 +616,12 @@ void QgsLegend::addLayer( QgsMapLayer * layer )
doItemsLayout();

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

QgsLegendLayerFile* QgsLegend::currentLayerFile()
Expand Down Expand Up @@ -1216,6 +1217,14 @@ bool QgsLegend::readXML( QDomNode& legendnode )

theLegendLayerFile->updateLegendItem();
refreshLayerSymbology( theMapLayer->getLayerID() );

// setup connections that will update the layer icons
if ( dynamic_cast<QgsVectorLayer *>( theMapLayer ) )
{
QgsDebugMsg( "Connecting signals for updating icons, layer " + theMapLayer->name() );
connect( theMapLayer, SIGNAL( editingStarted() ), lastLayer, SLOT( updateIcon() ) );
connect( theMapLayer, SIGNAL( editingStopped() ), lastLayer, SLOT( updateIcon() ) );
}
}
}
else if ( childelem.tagName() == "filegroup" )
Expand Down

0 comments on commit b730994

Please sign in to comment.