Skip to content

Commit

Permalink
The store can now add invalid maplayers
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Nov 5, 2018
1 parent bac5fbb commit bc4a1ef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgsmaplayerstore.sip.in
Expand Up @@ -104,7 +104,7 @@ The layersAdded() and layerWasAdded() signals will always be emitted.
the layers yourself. Not available in Python.

:return: a list of the map layers that were added
successfully. If a layer is invalid, or already exists in the store,
successfully. If a layer already exists in the store,
it will not be part of the returned list.


Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsmaplayerstore.cpp
Expand Up @@ -55,9 +55,9 @@ QList<QgsMapLayer *> QgsMapLayerStore::addMapLayers( const QList<QgsMapLayer *>
QList<QgsMapLayer *> myResultList;
Q_FOREACH ( QgsMapLayer *myLayer, layers )
{
if ( !myLayer || !myLayer->isValid() )
if ( !myLayer )
{
QgsDebugMsg( QStringLiteral( "Cannot add invalid layers" ) );
QgsDebugMsg( QStringLiteral( "Cannot add null layers" ) );
continue;
}
//check the layer is not already registered!
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmaplayerstore.h
Expand Up @@ -135,7 +135,7 @@ class CORE_EXPORT QgsMapLayerStore : public QObject
* the layers yourself. Not available in Python.
*
* \returns a list of the map layers that were added
* successfully. If a layer is invalid, or already exists in the store,
* successfully. If a layer already exists in the store,
* it will not be part of the returned list.
*
* \see addMapLayer()
Expand Down

0 comments on commit bc4a1ef

Please sign in to comment.