Skip to content

Commit

Permalink
[layertree] Rename childLayerIds() to findLayerIds()
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed May 30, 2014
1 parent 04dc5d8 commit b30ac31
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/core/layertree/qgslayertreegroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,13 @@ void QgsLayerTreeGroup::setVisible( Qt::CheckState state )
}
}

QStringList QgsLayerTreeGroup::childLayerIds() const
QStringList QgsLayerTreeGroup::findLayerIds() const
{
QStringList lst;
foreach ( QgsLayerTreeNode* child, mChildren )
{
if ( QgsLayerTree::isGroup( child ) )
lst << QgsLayerTree::toGroup( child )->childLayerIds();
lst << QgsLayerTree::toGroup( child )->findLayerIds();
else if ( QgsLayerTree::isLayer( child ) )
lst << QgsLayerTree::toLayer( child )->layerId();
}
Expand Down
3 changes: 1 addition & 2 deletions src/core/layertree/qgslayertreegroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class CORE_EXPORT QgsLayerTreeGroup : public QgsLayerTreeNode

QgsLayerTreeLayer* findLayer( const QString& layerId );
QList<QgsLayerTreeLayer*> findLayers() const;
QStringList findLayerIds() const;
QgsLayerTreeGroup* findGroup( const QString& name );

static QgsLayerTreeGroup* readXML( QDomElement& element );
Expand All @@ -68,8 +69,6 @@ class CORE_EXPORT QgsLayerTreeGroup : public QgsLayerTreeNode
Qt::CheckState isVisible() const { return mChecked; }
void setVisible( Qt::CheckState state );

QStringList childLayerIds() const;

protected slots:
void layerDestroyed();
void nodeVisibilityChanged( QgsLayerTreeNode* node );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1847,7 +1847,7 @@ QgsLayerTreeGroup* QgsProject::createEmbeddedGroup( const QString& groupName, co
mLayerTreeRegistryBridge->setEnabled( true );

// consider the layers might be identify disabled in its project
foreach ( QString layerId, newGroup->childLayerIds() )
foreach ( QString layerId, newGroup->findLayerIds() )
{
if ( embeddedIdentifyDisabledLayers.contains( layerId ) )
{
Expand Down
2 changes: 1 addition & 1 deletion src/gui/layertree/qgslayertreeviewdefaultactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void QgsLayerTreeViewDefaultActions::zoomToLayer( QgsMapCanvas* canvas )
void QgsLayerTreeViewDefaultActions::zoomToGroup( QgsMapCanvas* canvas )
{
QList<QgsMapLayer*> layers;
foreach ( QString layerId, mView->currentGroupNode()->childLayerIds() )
foreach ( QString layerId, mView->currentGroupNode()->findLayerIds() )
layers << QgsMapLayerRegistry::instance()->mapLayer( layerId );

zoomToLayers( canvas, layers );
Expand Down

0 comments on commit b30ac31

Please sign in to comment.