From c88e82af1ab5e0debae558b74fc9840abad6ee52 Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Fri, 27 Sep 2019 09:58:27 +0200 Subject: [PATCH] rename QgsLayerTreeRegistryBridge.InsertionPoint.parent to group (#32031) because I find it confusing to do insertionPoint.parent.insertLayer insertionPoint.group.insertLayer --- .../layertree/qgslayertreeregistrybridge.sip.in | 4 ++-- src/core/layertree/qgslayertreeregistrybridge.cpp | 4 ++-- src/core/layertree/qgslayertreeregistrybridge.h | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/python/core/auto_generated/layertree/qgslayertreeregistrybridge.sip.in b/python/core/auto_generated/layertree/qgslayertreeregistrybridge.sip.in index 9d985b5ffb5..eac97a1a22a 100644 --- a/python/core/auto_generated/layertree/qgslayertreeregistrybridge.sip.in +++ b/python/core/auto_generated/layertree/qgslayertreeregistrybridge.sip.in @@ -33,11 +33,11 @@ from the map layer registry. struct InsertionPoint { - InsertionPoint( QgsLayerTreeGroup *parent, int position ); + InsertionPoint( QgsLayerTreeGroup *group, int position ); %Docstring Construcs an insertion point as layer tree group with its corresponding position. %End - QgsLayerTreeGroup *parent; + QgsLayerTreeGroup *group; int position; }; diff --git a/src/core/layertree/qgslayertreeregistrybridge.cpp b/src/core/layertree/qgslayertreeregistrybridge.cpp index a7dd727f732..d8b8074c43e 100644 --- a/src/core/layertree/qgslayertreeregistrybridge.cpp +++ b/src/core/layertree/qgslayertreeregistrybridge.cpp @@ -38,7 +38,7 @@ QgsLayerTreeRegistryBridge::QgsLayerTreeRegistryBridge( QgsLayerTreeGroup *root, void QgsLayerTreeRegistryBridge::setLayerInsertionPoint( QgsLayerTreeGroup *parentGroup, int index ) { - mInsertionPoint.parent = parentGroup; + mInsertionPoint.group = parentGroup; mInsertionPoint.position = index; } @@ -71,7 +71,7 @@ void QgsLayerTreeRegistryBridge::layersAdded( const QList &layers } // add new layers to the right place - mInsertionPoint.parent->insertChildNodes( mInsertionPoint.position, nodes ); + mInsertionPoint.group->insertChildNodes( mInsertionPoint.position, nodes ); // tell other components that layers have been added - this signal is used in QGIS to auto-select the first layer emit addedLayersToLayerTree( layers ); diff --git a/src/core/layertree/qgslayertreeregistrybridge.h b/src/core/layertree/qgslayertreeregistrybridge.h index 899d6cdef37..de808b0ffd4 100644 --- a/src/core/layertree/qgslayertreeregistrybridge.h +++ b/src/core/layertree/qgslayertreeregistrybridge.h @@ -54,10 +54,10 @@ class CORE_EXPORT QgsLayerTreeRegistryBridge : public QObject struct InsertionPoint { //! Construcs an insertion point as layer tree group with its corresponding position. - InsertionPoint( QgsLayerTreeGroup *parent, int position ) - : parent( parent ), position( position ) {} + InsertionPoint( QgsLayerTreeGroup *group, int position ) + : group( group ), position( position ) {} - QgsLayerTreeGroup *parent = nullptr; + QgsLayerTreeGroup *group = nullptr; int position = 0; };