Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #52953 from YoannQDQ/fix-qgssettingstreenode-const…
…ness
  • Loading branch information
m-kuhn committed May 1, 2023
2 parents 5133ba0 + 3dcfbe8 commit 1de12f3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Expand Up @@ -103,7 +103,7 @@ Unregisters the child tree ``node``
Returns the children nodes
%End

QgsSettingsTreeNode *childNode( const QString &key );
QgsSettingsTreeNode *childNode( const QString &key ) const;
%Docstring
Returns the existing child node if it exists at the given ``key``
%End
Expand All @@ -113,7 +113,7 @@ Returns the existing child node if it exists at the given ``key``
Returns the children settings
%End

const QgsSettingsEntryBase *childSetting( const QString &key );
const QgsSettingsEntryBase *childSetting( const QString &key ) const;
%Docstring
Returns the existing child settings if it exists at the given ``key``
%End
Expand Down
4 changes: 2 additions & 2 deletions src/core/settings/qgssettingstreenode.cpp
Expand Up @@ -76,7 +76,7 @@ QgsSettingsTreeNamedListNode *QgsSettingsTreeNode::createNamedListNode( const QS
}


QgsSettingsTreeNode *QgsSettingsTreeNode::childNode( const QString &key )
QgsSettingsTreeNode *QgsSettingsTreeNode::childNode( const QString &key ) const
{
QList<QgsSettingsTreeNode *>::const_iterator it = mChildrenNodes.constBegin();
for ( ; it != mChildrenNodes.constEnd(); ++it )
Expand All @@ -87,7 +87,7 @@ QgsSettingsTreeNode *QgsSettingsTreeNode::childNode( const QString &key )
return nullptr;
}

const QgsSettingsEntryBase *QgsSettingsTreeNode::childSetting( const QString &key )
const QgsSettingsEntryBase *QgsSettingsTreeNode::childSetting( const QString &key ) const
{
const QString testCompleteKey = QStringLiteral( "%1%2" ).arg( mCompleteKey, key );
QList<const QgsSettingsEntryBase *>::const_iterator it = mChildrenSettings.constBegin();
Expand Down
4 changes: 2 additions & 2 deletions src/core/settings/qgssettingstreenode.h
Expand Up @@ -109,13 +109,13 @@ class CORE_EXPORT QgsSettingsTreeNode
QList<QgsSettingsTreeNode *> childrenNodes() const {return mChildrenNodes;}

//! Returns the existing child node if it exists at the given \a key
QgsSettingsTreeNode *childNode( const QString &key );
QgsSettingsTreeNode *childNode( const QString &key ) const;

//! Returns the children settings
QList<const QgsSettingsEntryBase *> childrenSettings() const {return mChildrenSettings;}

//! Returns the existing child settings if it exists at the given \a key
const QgsSettingsEntryBase *childSetting( const QString &key );
const QgsSettingsEntryBase *childSetting( const QString &key ) const;

//! Returns the parent of the node or nullptr if it does not exists
QgsSettingsTreeNode *parent() const {return mParent;}
Expand Down

0 comments on commit 1de12f3

Please sign in to comment.