@@ -54,11 +54,11 @@ QgsAuthOAuth2Method::QgsAuthOAuth2Method()
54
54
<< QStringLiteral ( " wcs" )
55
55
<< QStringLiteral ( " wms" ) );
56
56
57
- QStringList cachedirpaths;
58
- cachedirpaths << QgsAuthOAuth2Config::tokenCacheDirectory ()
59
- << QgsAuthOAuth2Config::tokenCacheDirectory ( true );
57
+ const QStringList cachedirpaths = QStringList ()
58
+ << QgsAuthOAuth2Config::tokenCacheDirectory ()
59
+ << QgsAuthOAuth2Config::tokenCacheDirectory ( true );
60
60
61
- Q_FOREACH ( const QString &cachedirpath, cachedirpaths )
61
+ for ( const QString &cachedirpath : cachedirpaths )
62
62
{
63
63
QDir cachedir ( cachedirpath );
64
64
if ( !cachedir.mkpath ( cachedirpath ) )
@@ -71,10 +71,10 @@ QgsAuthOAuth2Method::QgsAuthOAuth2Method()
71
71
QgsAuthOAuth2Method::~QgsAuthOAuth2Method ()
72
72
{
73
73
QDir tempdir ( QgsAuthOAuth2Config::tokenCacheDirectory ( true ) );
74
- QStringList dirlist = tempdir.entryList ( QDir::Files | QDir::NoDotAndDotDot );
75
- Q_FOREACH ( const QString &f, dirlist )
74
+ const QStringList dirlist = tempdir.entryList ( QDir::Files | QDir::NoDotAndDotDot );
75
+ for ( const QString &f : dirlist )
76
76
{
77
- QString tempfile ( tempdir.path () + QStringLiteral ( " / " ) + f );
77
+ QString tempfile ( tempdir.path () + ' / ' + f );
78
78
if ( !QFile::remove ( tempfile ) )
79
79
{
80
80
QgsDebugMsg ( QStringLiteral ( " FAILED to delete temp token cache file: %1" ).arg ( tempfile ) );
@@ -343,7 +343,8 @@ void QgsAuthOAuth2Method::onLinkingSucceeded()
343
343
if ( !extraTokens.isEmpty () )
344
344
{
345
345
QString msg = QStringLiteral ( " Extra tokens in response:\n " );
346
- Q_FOREACH ( const QString &key, extraTokens.keys () )
346
+ const QStringList extraTokenKeys = extraTokens.keys ();
347
+ for ( const QString &key : extraTokenKeys )
347
348
{
348
349
// don't expose the values in a log (unless they are only 3 chars long, of course)
349
350
msg += QStringLiteral ( " %1:%2…\n " ).arg ( key, extraTokens.value ( key ).toString ().left ( 3 ) );
@@ -371,7 +372,8 @@ void QgsAuthOAuth2Method::onCloseBrowser()
371
372
// Bring focus back to QGIS app
372
373
if ( qobject_cast<QApplication *>( qApp ) )
373
374
{
374
- Q_FOREACH ( QWidget *topwdgt, QgsApplication::topLevelWidgets () )
375
+ const QList<QWidget *> widgets = QgsApplication::topLevelWidgets ();
376
+ for ( QWidget *topwdgt : widgets )
375
377
{
376
378
if ( topwdgt->objectName () == QStringLiteral ( " MainWindow" ) )
377
379
{
0 commit comments