rename QgsLayerTreeRegistryBridge.InsertionPoint.parent to group (#32031)

because I find it confusing to do insertionPoint.parent.insertLayer
insertionPoint.group.insertLayer
This commit is contained in:
Denis Rouzaud 2019-09-27 09:58:27 +02:00 committed by GitHub
parent f75a0cc4da
commit c88e82af1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -33,11 +33,11 @@ from the map layer registry.
struct InsertionPoint struct InsertionPoint
{ {
InsertionPoint( QgsLayerTreeGroup *parent, int position ); InsertionPoint( QgsLayerTreeGroup *group, int position );
%Docstring %Docstring
Construcs an insertion point as layer tree group with its corresponding position. Construcs an insertion point as layer tree group with its corresponding position.
%End %End
QgsLayerTreeGroup *parent; QgsLayerTreeGroup *group;
int position; int position;
}; };

View File

@ -38,7 +38,7 @@ QgsLayerTreeRegistryBridge::QgsLayerTreeRegistryBridge( QgsLayerTreeGroup *root,
void QgsLayerTreeRegistryBridge::setLayerInsertionPoint( QgsLayerTreeGroup *parentGroup, int index ) void QgsLayerTreeRegistryBridge::setLayerInsertionPoint( QgsLayerTreeGroup *parentGroup, int index )
{ {
mInsertionPoint.parent = parentGroup; mInsertionPoint.group = parentGroup;
mInsertionPoint.position = index; mInsertionPoint.position = index;
} }
@ -71,7 +71,7 @@ void QgsLayerTreeRegistryBridge::layersAdded( const QList<QgsMapLayer *> &layers
} }
// add new layers to the right place // 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 // tell other components that layers have been added - this signal is used in QGIS to auto-select the first layer
emit addedLayersToLayerTree( layers ); emit addedLayersToLayerTree( layers );

View File

@ -54,10 +54,10 @@ class CORE_EXPORT QgsLayerTreeRegistryBridge : public QObject
struct InsertionPoint struct InsertionPoint
{ {
//! Construcs an insertion point as layer tree group with its corresponding position. //! Construcs an insertion point as layer tree group with its corresponding position.
InsertionPoint( QgsLayerTreeGroup *parent, int position ) InsertionPoint( QgsLayerTreeGroup *group, int position )
: parent( parent ), position( position ) {} : group( group ), position( position ) {}
QgsLayerTreeGroup *parent = nullptr; QgsLayerTreeGroup *group = nullptr;
int position = 0; int position = 0;
}; };