Skip to content

Commit

Permalink
Renamed method addChildSettingsRegistry to appendRegistry
Browse files Browse the repository at this point in the history
  • Loading branch information
domi4484 committed Apr 26, 2021
1 parent 95e7360 commit 8a7bfa1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/core/settings/qgssettingsregistry.cpp
Expand Up @@ -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 )
{
Expand Down
4 changes: 2 additions & 2 deletions src/core/settings/qgssettingsregistry.h
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions tests/src/core/testqgssettingsregistry.cpp
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion tests/src/python/test_qgssettingsregistry.py
Expand Up @@ -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)

Expand Down

0 comments on commit 8a7bfa1

Please sign in to comment.