Skip to content

Commit

Permalink
Merge pull request #58719 from elpaso/bugfix-authstorage-api-qt6
Browse files Browse the repository at this point in the history
Auth storage API fix debug code with QT6
  • Loading branch information
elpaso authored Sep 16, 2024
2 parents fce8f62 + a0ec39a commit 6c52cb2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/core/auth/qgsauthconfigurationstoragedb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,25 @@ bool QgsAuthConfigurationStorageDb::authDbQuery( QSqlQuery *query, const QString

auto boundQuery = []( const QSqlQuery * query ) -> QString
{
#ifdef QGISDEBUG
QString str = query->lastQuery();
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
QMapIterator<QString, QVariant> it( query->boundValues() );
#else
const QStringList keys = query->boundValueNames();
const QVariantList values = query->boundValues();
QMap<QString, QVariant> boundValues;
for ( int i=0; i<keys.count(); i++)
{
boundValues.insert( keys.at( i ), values.at( i ).toString() );
}
QMapIterator<QString, QVariant> it = QMapIterator<QString, QVariant>( boundValues );
#endif
while ( it.hasNext() )
{
it.next();
str.replace( it.key(), it.value().toString() );
}
return str;
#endif
return query->executedQuery();
};

if ( !result )
Expand Down

0 comments on commit 6c52cb2

Please sign in to comment.