Skip to content
Permalink
Browse files

Apply suggestions from code review

Co-authored-by: Paul Blottiere <blottiere.paul@gmail.com>
  • Loading branch information
domi4484 and pblottiere committed Apr 26, 2021
1 parent 1b10f18 commit 95e7360f7933b03b6ad257878689230ce6b7eafe
Showing with 3 additions and 4 deletions.
  1. +2 −3 src/core/settings/qgssettingsentry.cpp
  2. +1 −1 src/core/settings/qgssettingsregistry.cpp
@@ -117,8 +117,8 @@ bool QgsSettingsEntryBase::keyIsValid( const QString &key ) const
if ( !hasDynamicKey() )
return completeKeyToCheck == prefixedSettingsKey;

QRegularExpression regularExpression( prefixedSettingsKey.replace( QRegularExpression( QStringLiteral( "%\\d+" ) ), QStringLiteral( ".*" ) ) );
QRegularExpressionMatch regularExpressionMatch = regularExpression.match( completeKeyToCheck );
const QRegularExpression regularExpression( prefixedSettingsKey.replace( QRegularExpression( QStringLiteral( "%\\d+" ) ), QStringLiteral( ".*" ) ) );
const QRegularExpressionMatch regularExpressionMatch = regularExpression.match( completeKeyToCheck );
return regularExpressionMatch.hasMatch();
}

@@ -643,4 +643,3 @@ int QgsSettingsEntryDouble::displayHintDecimals() const
}



@@ -73,7 +73,7 @@ const QgsSettingsEntryBase *QgsSettingsRegistry::getSettingsEntry( const QString
for ( const QgsSettingsRegistry *settingsRegistry : std::as_const( mSettingsRegistryChildList ) )
{
const QgsSettingsEntryBase *settingsEntry = settingsRegistry->getSettingsEntry( key, true );
if ( settingsEntry != nullptr )
if ( settingsEntry )
return settingsEntry;
}
}

0 comments on commit 95e7360

Please sign in to comment.