mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -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
|
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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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 );
|
||||||
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user