From d2ba9d09628e1f0548e5a8747b222e713f6f4055 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 7 Sep 2014 21:22:27 +0200 Subject: [PATCH] QIcon: use qEnvironmentVariableIsEmpty() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It doesn't allocate memory, so cannot throw and is a lot faster than qgetenv(). Change-Id: I427aa5bf5b8d76aabdd5ce5950e9e6762f79b8d8 Reviewed-by: Jędrzej Nowacki Reviewed-by: Gunnar Sletta --- src/gui/image/qicon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index 1e4a9ebe8c..aa39e91863 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -1032,7 +1032,7 @@ void QIcon::addFile(const QString &fileName, const QSize &size, Mode mode, State d->engine->addFile(fileName, size, mode, state); // Check if a "@2x" file exists and add it. - static bool disable2xImageLoading = !qgetenv("QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING").isEmpty(); + static bool disable2xImageLoading = !qEnvironmentVariableIsEmpty("QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING"); if (!disable2xImageLoading && qApp->devicePixelRatio() > 1.0) { int dotIndex = fileName.lastIndexOf(QLatin1Char('.')); if (dotIndex != -1) {