mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
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:
parent
f75a0cc4da
commit
c88e82af1a
@ -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;
|
||||
};
|
||||
|
||||
|
@ -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<QgsMapLayer *> &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 );
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user