26 QgsMapLayerRegistry::QgsMapLayerRegistry( QObject *parent ) : QObject( parent )
39 return mMapLayers.size();
44 return mMapLayers.value( theLayerId );
49 QList<QgsMapLayer *> myResultList;
52 if ( layer->
name() == layerName )
54 myResultList << layer;
62 QList<QgsMapLayer *> theMapLayers,
66 QList<QgsMapLayer *> myResultList;
67 for (
int i = 0; i < theMapLayers.size(); ++i )
70 if ( !myLayer || !myLayer->
isValid() )
76 if ( !mMapLayers.contains( myLayer->
id() ) )
78 mMapLayers[myLayer->
id()] = myLayer;
79 myResultList << mMapLayers[myLayer->
id()];
81 mOwnedLayers << myLayer;
85 if ( myResultList.count() > 0 )
101 QList<QgsMapLayer *> addedLayers;
102 addedLayers =
addMapLayers( QList<QgsMapLayer*>() << theMapLayer, addToLegend, takeOwnership );
103 return addedLayers.isEmpty() ? 0 : addedLayers[0];
112 foreach (
const QString &myId, theLayerIds )
115 if ( mOwnedLayers.contains( lyr ) )
119 mOwnedLayers.remove( lyr );
121 mMapLayers.remove( myId );
147 QMap<QString, QgsMapLayer *>::iterator it;
148 for ( it = mMapLayers.begin(); it != mMapLayers.end() ; ++it )
165 void QgsMapLayerRegistry::connectNotify(
const char * signal )