Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth storage API fix debug code with QT6 #58719

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ( const auto &key : std::as_const( keys ) )
{
boundValues.insert( key, values.at( keys.indexOf( key ) ).toString() );
}
elpaso marked this conversation as resolved.
Show resolved Hide resolved
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