Fixed bug with signal being emitted declaring layers were added but having a zero length layer list

This commit is contained in:
Tim Sutton 2012-04-14 19:57:29 +02:00
parent 23d53627d4
commit ba003e6ee3

View File

@ -84,8 +84,10 @@ QList<QgsMapLayer *> QgsMapLayerRegistry::addMapLayers(
emit layerWasAdded( myLayer ); emit layerWasAdded( myLayer );
} }
} }
if ( theEmitSignal ) if ( theEmitSignal && myResultList.count() > 0 )
{
emit layersAdded( myResultList ); emit layersAdded( myResultList );
}
return myResultList; return myResultList;
} // QgsMapLayerRegistry::addMapLayers } // QgsMapLayerRegistry::addMapLayers