Skip to content
Permalink
Browse files

Renamed method addChildSettingsRegistry to appendRegistry

  • Loading branch information
domi4484 committed Apr 26, 2021
1 parent 95e7360 commit 8a7bfa18e15fb0bdd9c1660f9754b987c46c2594
@@ -43,9 +43,9 @@ Returns the :py:class:`QgsSettingsEntry` with the given ``key`` or None if not f
The ``searchChildRegistries`` parameter specifies if child registries should be included in the search
%End

void addChildSettingsRegistry( const QgsSettingsRegistry *settingsRegistry );
void appendRegistry( const QgsSettingsRegistry *settingsRegistry );
%Docstring
Add a child ``settingsRegistry`` to the register.
Append a child ``settingsRegistry`` to the register.
%End

QList<const QgsSettingsRegistry *> getChildSettingsRegistries() const;
@@ -81,7 +81,7 @@ const QgsSettingsEntryBase *QgsSettingsRegistry::getSettingsEntry( const QString
return nullptr;
}

void QgsSettingsRegistry::addChildSettingsRegistry( const QgsSettingsRegistry *settingsRegistry )
void QgsSettingsRegistry::appendRegistry( const QgsSettingsRegistry *settingsRegistry )
{
if ( !settingsRegistry )
{
@@ -58,9 +58,9 @@ class CORE_EXPORT QgsSettingsRegistry
const QgsSettingsEntryBase *getSettingsEntry( const QString &key, bool searchChildRegistries = true ) const;

/**
* Add a child \a settingsRegistry to the register.
* Append a child \a settingsRegistry to the register.
*/
void addChildSettingsRegistry( const QgsSettingsRegistry *settingsRegistry );
void appendRegistry( const QgsSettingsRegistry *settingsRegistry );

/**
* Returns the list of registered child QgsSettingsRegistry.
@@ -103,8 +103,8 @@ void TestQgsSettingsRegistry::childRegistry()

SettingsRegistryTest settingsRegistry;
settingsRegistry.addSettingsEntry( &settingsEntryBool );
settingsRegistry.addChildSettingsRegistry( nullptr ); // should not crash
settingsRegistry.addChildSettingsRegistry( &settingsRegistryChild );
settingsRegistry.appendRegistry( nullptr ); // should not crash
settingsRegistry.appendRegistry( &settingsRegistryChild );

// Search only in parent
QCOMPARE( settingsRegistry.getSettingsEntry( settingsEntryIntegerKey, false ), nullptr );
@@ -38,7 +38,7 @@ def test_settings_registry(self):
self.assertEqual(settingsRegistry.getSettingsEntry(settingsEntry.key(), False), settingsEntry)

# add registry to core registry
QgsApplication.settingsRegistryCore().addChildSettingsRegistry(settingsRegistry)
QgsApplication.settingsRegistryCore().appendRegistry(settingsRegistry)

self.assertEqual(QgsApplication.settingsRegistryCore().getSettingsEntry(settingsEntry.key(), True), settingsEntry)

0 comments on commit 8a7bfa1

Please sign in to comment.