Skip to content
Permalink
Browse files

Adding connection of signals when reading legend layers from project …

…XML file. Fixes #1760

git-svn-id: http://svn.osgeo.org/qgis/trunk@11405 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
homann
homann committed Aug 17, 2009
1 parent 309ccfc commit e5d72719eeb4eb3f05bc3a5415172c174990c514
Showing with 11 additions and 2 deletions.
  1. +11 −2 src/app/legend/qgslegend.cpp
@@ -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()
@@ -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" )

0 comments on commit e5d7271

Please sign in to comment.
You can’t perform that action at this time.