Removed dead legend code
Do not emit currentLayerChanged signal if the layer has not changed