Skip to content

Commit

Permalink
astyle
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Jul 9, 2024
1 parent a0281ff commit 86a342e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/core/auth/qgsauthconfigurationstoragedb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,15 @@ bool QgsAuthConfigurationStorageDb::authDbQuery( QSqlQuery *query, const QString
query->setForwardOnly( true );
const bool result { sql.isEmpty() ? query->exec() : query->exec( sql ) };

auto boundQuery = [](const QSqlQuery *query) -> QString {
auto boundQuery = []( const QSqlQuery * query ) -> QString
{
#ifdef QGISDEBUG
QString str = query->lastQuery();
QMapIterator<QString, QVariant> it(query->boundValues());
while (it.hasNext())
QMapIterator<QString, QVariant> it( query->boundValues() );
while ( it.hasNext() )
{
it.next();
str.replace(it.key(),it.value().toString());
it.next();
str.replace( it.key(), it.value().toString() );
}
return str;
#endif
Expand All @@ -172,7 +173,7 @@ bool QgsAuthConfigurationStorageDb::authDbQuery( QSqlQuery *query, const QString
if ( query->lastError().isValid() )
{
const_cast< QgsAuthConfigurationStorageDb * >( this )->setError( tr( "Auth db query FAILED: %1\nError: %2" )
.arg( sql.isEmpty() ? boundQuery( query ) : sql,
.arg( sql.isEmpty() ? boundQuery( query ) : sql,
query->lastError().text() ), Qgis::MessageLevel::Warning );
QgsDebugMsgLevel( QStringLiteral( "Auth db query FAILED: %1" ).arg( sql.isEmpty() ? boundQuery( query ) : sql ), 2 );
return false;
Expand Down Expand Up @@ -1877,7 +1878,7 @@ bool QgsAuthConfigurationStorageDb::removeMethodConfig( const QString &id )
return false;
}

if( query.numRowsAffected() == 0 )
if ( query.numRowsAffected() == 0 )
{
setError( tr( "Config '%1' does not exist" ).arg( id ), Qgis::MessageLevel::Warning );
return false;
Expand Down Expand Up @@ -1972,7 +1973,7 @@ bool QgsAuthConfigurationStorageDb::removeAuthSetting( const QString &key )
return false;
}

if( query.numRowsAffected() == 0 )
if ( query.numRowsAffected() == 0 )
{
const_cast< QgsAuthConfigurationStorageDb * >( this )->setError( tr( "Setting '%1' does not exist" ).arg( key ), Qgis::MessageLevel::Warning );
return false;
Expand Down

0 comments on commit 86a342e

Please sign in to comment.