aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickimagebase.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-10-22 12:36:18 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-10-26 10:26:02 +0000
commitf9fae251ca07401ee1b0039edc6ea6b7a522b5a7 (patch)
tree2dff3c7006f5a00ab6791a0e932109807a217ab4 /src/quick/items/qquickimagebase.cpp
parent901b88c6ae6c476a8ad9825d9020325a9a58ab61 (diff)
Quick: Sanitize reading environment variables.
Where possible, use qEnvironmentVariableIsSet()/ qEnvironmentVariableIsEmpty() instead of checking on the return value of qgetenv(). Where the value is required, add a check using one of qEnvironmentVariableIsSet()/Empty(). Move QSGAtlasTexture::qsg_envInt() to qsgrenderer.cpp for reuse as qt_sg_envInt() and add qt_sg_envFloat(). Change-Id: I4c93f16c228d4f537154f389a0fa1427654485f7 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/quick/items/qquickimagebase.cpp')
-rw-r--r--src/quick/items/qquickimagebase.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/items/qquickimagebase.cpp b/src/quick/items/qquickimagebase.cpp
index c37e6c942c..073fe58e7b 100644
--- a/src/quick/items/qquickimagebase.cpp
+++ b/src/quick/items/qquickimagebase.cpp
@@ -358,7 +358,7 @@ void QQuickImageBase::resolve2xLocalFile(const QUrl &url, qreal targetDevicePixe
Q_ASSERT(sourceDevicePixelRatio);
// Bail out if "@2x" image loading is disabled, don't change the source url or devicePixelRatio.
- static bool disable2xImageLoading = !qgetenv("QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING").isEmpty();
+ static const bool disable2xImageLoading = !qEnvironmentVariableIsEmpty("QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING");
if (disable2xImageLoading)
return;