Skip to content

Commit b730994

Browse files
author
homann
committed
Adding connection of signals when reading legend layers from project XML file. Fixes #1760
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11405 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 61f4676 commit b730994

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/app/legend/qgslegend.cpp

+11-2
Original file line numberDiff line numberDiff line change
@@ -616,11 +616,12 @@ void QgsLegend::addLayer( QgsMapLayer * layer )
616616
doItemsLayout();
617617

618618
// setup connections that will update the layer icons
619-
if( dynamic_cast<QgsVectorLayer *>( layer ) )
619+
if ( dynamic_cast<QgsVectorLayer *>( layer ) )
620620
{
621+
QgsDebugMsg( "Connecting signals for updating icons, layer " + layer->name() );
621622
connect( layer, SIGNAL( editingStarted() ), llayer, SLOT( updateIcon() ) );
622623
connect( layer, SIGNAL( editingStopped() ), llayer, SLOT( updateIcon() ) );
623-
}
624+
}
624625
}
625626

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

12171218
theLegendLayerFile->updateLegendItem();
12181219
refreshLayerSymbology( theMapLayer->getLayerID() );
1220+
1221+
// setup connections that will update the layer icons
1222+
if ( dynamic_cast<QgsVectorLayer *>( theMapLayer ) )
1223+
{
1224+
QgsDebugMsg( "Connecting signals for updating icons, layer " + theMapLayer->name() );
1225+
connect( theMapLayer, SIGNAL( editingStarted() ), lastLayer, SLOT( updateIcon() ) );
1226+
connect( theMapLayer, SIGNAL( editingStopped() ), lastLayer, SLOT( updateIcon() ) );
1227+
}
12191228
}
12201229
}
12211230
else if ( childelem.tagName() == "filegroup" )

0 commit comments

Comments
 (0)