@@ -616,11 +616,12 @@ void QgsLegend::addLayer( QgsMapLayer * layer )
616
616
doItemsLayout ();
617
617
618
618
// setup connections that will update the layer icons
619
- if ( dynamic_cast <QgsVectorLayer *>( layer ) )
619
+ if ( dynamic_cast <QgsVectorLayer *>( layer ) )
620
620
{
621
+ QgsDebugMsg ( " Connecting signals for updating icons, layer " + layer->name () );
621
622
connect ( layer, SIGNAL ( editingStarted () ), llayer, SLOT ( updateIcon () ) );
622
623
connect ( layer, SIGNAL ( editingStopped () ), llayer, SLOT ( updateIcon () ) );
623
- }
624
+ }
624
625
}
625
626
626
627
QgsLegendLayerFile* QgsLegend::currentLayerFile ()
@@ -1216,6 +1217,14 @@ bool QgsLegend::readXML( QDomNode& legendnode )
1216
1217
1217
1218
theLegendLayerFile->updateLegendItem ();
1218
1219
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
+ }
1219
1228
}
1220
1229
}
1221
1230
else if ( childelem.tagName () == " filegroup" )
0 commit comments