Use qEnvironmentVariableIntValue() instead of qgetenv().toInt()
The docs tell us that it's faster. Pick-to: 6.2 Change-Id: Ib828ed9a10bbb617670a61e7525cbbe25704815d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This commit is contained in:
parent
e02964f01a
commit
ca89437d00
|
@ -59,13 +59,13 @@
|
||||||
app.setOrganizationDomain("qt-project.org");\
|
app.setOrganizationDomain("qt-project.org");\
|
||||||
app.setApplicationName(QFileInfo(app.applicationFilePath()).baseName());\
|
app.setApplicationName(QFileInfo(app.applicationFilePath()).baseName());\
|
||||||
QQuickView view;\
|
QQuickView view;\
|
||||||
if (qgetenv("QT_QUICK_CORE_PROFILE").toInt()) {\
|
if (qEnvironmentVariableIntValue("QT_QUICK_CORE_PROFILE")) {\
|
||||||
QSurfaceFormat f = view.format();\
|
QSurfaceFormat f = view.format();\
|
||||||
f.setProfile(QSurfaceFormat::CoreProfile);\
|
f.setProfile(QSurfaceFormat::CoreProfile);\
|
||||||
f.setVersion(4, 4);\
|
f.setVersion(4, 4);\
|
||||||
view.setFormat(f);\
|
view.setFormat(f);\
|
||||||
}\
|
}\
|
||||||
if (qgetenv("QT_QUICK_MULTISAMPLE").toInt()) {\
|
if (qEnvironmentVariableIntValue("QT_QUICK_MULTISAMPLE")) {\
|
||||||
QSurfaceFormat f = view.format();\
|
QSurfaceFormat f = view.format();\
|
||||||
f.setSamples(4);\
|
f.setSamples(4);\
|
||||||
view.setFormat(f);\
|
view.setFormat(f);\
|
||||||
|
|
|
@ -55,7 +55,7 @@ int qt_sg_envInt(const char *name, int defaultValue)
|
||||||
if (Q_LIKELY(!qEnvironmentVariableIsSet(name)))
|
if (Q_LIKELY(!qEnvironmentVariableIsSet(name)))
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
int value = qgetenv(name).toInt(&ok);
|
int value = qEnvironmentVariableIntValue(name, &ok);
|
||||||
return ok ? value : defaultValue;
|
return ok ? value : defaultValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ void tst_Snippets::initTestCase()
|
||||||
|
|
||||||
QDir screenshotsDir(QDir::current().filePath("screenshots"));
|
QDir screenshotsDir(QDir::current().filePath("screenshots"));
|
||||||
|
|
||||||
takeScreenshots = qgetenv("SCREENSHOTS").toInt();
|
takeScreenshots = qEnvironmentVariableIntValue("SCREENSHOTS");
|
||||||
if (takeScreenshots)
|
if (takeScreenshots)
|
||||||
QVERIFY(screenshotsDir.exists() || QDir::current().mkpath("screenshots"));
|
QVERIFY(screenshotsDir.exists() || QDir::current().mkpath("screenshots"));
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
using namespace QQuickVisualTestUtil;
|
using namespace QQuickVisualTestUtil;
|
||||||
|
|
||||||
static int qt_verbose = qgetenv("VERBOSE").toInt() != 0;
|
static int qt_verbose = qEnvironmentVariableIntValue("VERBOSE") != 0;
|
||||||
|
|
||||||
Q_GLOBAL_STATIC(QObjectList, qt_qobjects)
|
Q_GLOBAL_STATIC(QObjectList, qt_qobjects)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue