tst_selftests: compile with QT_NO_FOREACH
The loop was iterating over a temporary container, so it couldn't have changed it. Use a const auto variable to hold the container and port to ranged-for Task-number: QTBUG-115839 Change-Id: I66e7cbdb811666ca352cdf064b1228caa346d876 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>bb10
parent
f516cf93b4
commit
890a61fba0
|
|
@ -2,8 +2,6 @@
|
|||
// Copyright (C) 2016 Intel Corporation.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
|
||||
QT_REQUIRE_CONFIG(process);
|
||||
|
|
@ -934,7 +932,8 @@ static QProcessEnvironment testEnvironment()
|
|||
if (environment.isEmpty()) {
|
||||
const QProcessEnvironment systemEnvironment = QProcessEnvironment::systemEnvironment();
|
||||
const bool preserveLibPath = qEnvironmentVariableIsSet("QT_PRESERVE_TESTLIB_PATH");
|
||||
foreach (const QString &key, systemEnvironment.keys()) {
|
||||
const auto envKeys = systemEnvironment.keys();
|
||||
for (const QString &key : envKeys) {
|
||||
const bool useVariable = key == "PATH" || key == "QT_QPA_PLATFORM"
|
||||
#if defined(Q_OS_QNX)
|
||||
|| key == "GRAPHICS_ROOT" || key == "TZ"
|
||||
|
|
|
|||
Loading…
Reference in New Issue