From 099f188bc8b21ae96d7839c4bae636b922b9e988 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 9 Sep 2014 11:48:24 +0200 Subject: [PATCH] xcb: use qEnvironmentVariableIntValue() It doesn't allocate memory, so cannot throw and is a lot faster than qgetenv(). Change-Id: Ie625d79352fa166e45939ef8f0a5e0cc32f8e801 Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbscreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp index 83ffb02362..691fba59d6 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.cpp +++ b/src/plugins/platforms/xcb/qxcbscreen.cpp @@ -328,7 +328,7 @@ QDpi QXcbScreen::logicalDpi() const qreal QXcbScreen::devicePixelRatio() const { - static int override_dpr = qgetenv("QT_DEVICE_PIXEL_RATIO").toInt(); + static int override_dpr = qEnvironmentVariableIntValue("QT_DEVICE_PIXEL_RATIO"); static bool auto_dpr = qgetenv("QT_DEVICE_PIXEL_RATIO").toLower() == "auto"; if (override_dpr > 0) return override_dpr;