mirror of
https://github.com/qgis/QGIS.git
synced 2025-11-22 00:14:55 -05:00
Rename QgsPolymorphicRelations getGeneratedRelations -> generateRelations
This commit is contained in:
parent
41e1e61513
commit
f8b468a045
@ -219,7 +219,7 @@ Sets a list of layer ids to be used as potential referenced layers
|
||||
Returns a list of layer ids to be used as potential referenced layers
|
||||
%End
|
||||
|
||||
QList<QgsRelation> getGeneratedRelations() const;
|
||||
QList<QgsRelation> generateRelations() const;
|
||||
%Docstring
|
||||
Returns a list of generated relations, based on the currently set :py:func:`~QgsPolymorphicRelation.referencedLayerIds`
|
||||
%End
|
||||
|
||||
@ -357,7 +357,7 @@ QStringList QgsPolymorphicRelation::referencedLayerIds() const
|
||||
return d->mReferencedLayerIds;
|
||||
}
|
||||
|
||||
QList<QgsRelation> QgsPolymorphicRelation::getGeneratedRelations() const
|
||||
QList<QgsRelation> QgsPolymorphicRelation::generateRelations() const
|
||||
{
|
||||
QList<QgsRelation> relations;
|
||||
|
||||
|
||||
@ -267,7 +267,7 @@ class CORE_EXPORT QgsPolymorphicRelation
|
||||
/**
|
||||
* Returns a list of generated relations, based on the currently set referencedLayerIds()
|
||||
*/
|
||||
QList<QgsRelation> getGeneratedRelations() const;
|
||||
QList<QgsRelation> generateRelations() const;
|
||||
|
||||
/**
|
||||
* Returns layer representation as evaluated string
|
||||
|
||||
@ -328,7 +328,7 @@ void QgsRelationManager::addPolymorphicRelation( const QgsPolymorphicRelation &p
|
||||
|
||||
mPolymorphicRelations.insert( polymorphicRelation.id(), polymorphicRelation );
|
||||
|
||||
const QList<QgsRelation> generatedRelations = polymorphicRelation.getGeneratedRelations();
|
||||
const QList<QgsRelation> generatedRelations = polymorphicRelation.generateRelations();
|
||||
for ( const QgsRelation &generatedRelation : generatedRelations )
|
||||
addRelation( generatedRelation );
|
||||
}
|
||||
@ -337,7 +337,7 @@ void QgsRelationManager::removePolymorphicRelation( const QString &polymorphicRe
|
||||
{
|
||||
QgsPolymorphicRelation relation = mPolymorphicRelations.take( polymorphicRelationId );
|
||||
|
||||
const QList<QgsRelation> generatedRelations = relation.getGeneratedRelations();
|
||||
const QList<QgsRelation> generatedRelations = relation.generateRelations();
|
||||
for ( const QgsRelation &generatedRelation : generatedRelations )
|
||||
removeRelation( generatedRelation.id() );
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ class TestQgsRelation(unittest.TestCase):
|
||||
|
||||
self.assertEqual(poly_rel.layerRepresentation(self.referencedLayer1), 'referencedlayer1')
|
||||
|
||||
def test_getGeneratedRelations(self):
|
||||
def test_generateRelations(self):
|
||||
poly_rel = QgsPolymorphicRelation()
|
||||
poly_rel.setId('poly_rel1')
|
||||
poly_rel.setName('Polymorphic Relation Number One')
|
||||
@ -178,7 +178,7 @@ class TestQgsRelation(unittest.TestCase):
|
||||
|
||||
self.assertTrue(poly_rel.isValid())
|
||||
|
||||
rels = poly_rel.getGeneratedRelations()
|
||||
rels = poly_rel.generateRelations()
|
||||
|
||||
self.assertEqual(len(rels), 2)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user