diff --git a/src/core/auth/qgsauthconfigurationstoragedb.cpp b/src/core/auth/qgsauthconfigurationstoragedb.cpp index 24c440dc6c8d..57ada2f353cc 100644 --- a/src/core/auth/qgsauthconfigurationstoragedb.cpp +++ b/src/core/auth/qgsauthconfigurationstoragedb.cpp @@ -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 it(query->boundValues()); - while (it.hasNext()) + QMapIterator 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 @@ -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; @@ -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; @@ -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;