From fcdd613dbeb9945604f15c164b4c97aba4f195a0 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 13 Aug 2021 16:00:13 +0200 Subject: Use qEnvironmentVariableIntValue() instead of qgetenv().toInt() The docs tell us that it's faster. Change-Id: Ib828ed9a10bbb617670a61e7525cbbe25704815d Reviewed-by: Mitch Curtis (cherry picked from commit ca89437d00aeb8916738a964a62aef3cff7dc5ab) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/quickcontrols2/snippets/tst_snippets.cpp | 2 +- tests/benchmarks/quickcontrols2/objectcount/tst_objectcount.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/auto/quickcontrols2/snippets/tst_snippets.cpp b/tests/auto/quickcontrols2/snippets/tst_snippets.cpp index 17ae6aa614..6be53d274e 100644 --- a/tests/auto/quickcontrols2/snippets/tst_snippets.cpp +++ b/tests/auto/quickcontrols2/snippets/tst_snippets.cpp @@ -79,7 +79,7 @@ void tst_Snippets::initTestCase() QDir screenshotsDir(QDir::current().filePath("screenshots")); - takeScreenshots = qgetenv("SCREENSHOTS").toInt(); + takeScreenshots = qEnvironmentVariableIntValue("SCREENSHOTS"); if (takeScreenshots) QVERIFY(screenshotsDir.exists() || QDir::current().mkpath("screenshots")); diff --git a/tests/benchmarks/quickcontrols2/objectcount/tst_objectcount.cpp b/tests/benchmarks/quickcontrols2/objectcount/tst_objectcount.cpp index bbcb24ca38..ea2a63dc52 100644 --- a/tests/benchmarks/quickcontrols2/objectcount/tst_objectcount.cpp +++ b/tests/benchmarks/quickcontrols2/objectcount/tst_objectcount.cpp @@ -42,7 +42,7 @@ using namespace QQuickVisualTestUtil; -static int qt_verbose = qgetenv("VERBOSE").toInt() != 0; +static int qt_verbose = qEnvironmentVariableIntValue("VERBOSE") != 0; Q_GLOBAL_STATIC(QObjectList, qt_qobjects) -- cgit v1.2.3