From 1dce3b7d11a0e61a779dc41297b3fd55a09c50e0 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 9 Sep 2014 11:48:01 +0200 Subject: [PATCH] QNX: use qEnvironmentVariableIntValue() It doesn't allocate memory, so cannot throw and is a lot faster than qgetenv(). Change-Id: I211d6de32da06bf465c4f721f39d73289206745f Reviewed-by: Alan Alpert --- src/plugins/platforms/qnx/qqnxscreen.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp index 59dc84ebc8..339ed06b8e 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.cpp +++ b/src/plugins/platforms/qnx/qqnxscreen.cpp @@ -313,7 +313,7 @@ static int defaultDepth() if (defaultDepth == 0) { // check if display depth was specified in environment variable; // use default value if no valid value found - defaultDepth = qgetenv("QQNX_DISPLAY_DEPTH").toInt(); + defaultDepth = qEnvironmentVariableIntValue("QQNX_DISPLAY_DEPTH"); if (defaultDepth != 16 && defaultDepth != 32) defaultDepth = 32; } @@ -687,7 +687,7 @@ void QQnxScreen::adjustOrientation() return; bool ok = false; - const int rotation = qgetenv("ORIENTATION").toInt(&ok); + const int rotation = qEnvironmentVariableIntValue("ORIENTATION", &ok); if (ok) setRotation(rotation); @@ -866,7 +866,7 @@ void QQnxScreen::setRootWindow(QQnxWindow *window) { // Optionally disable the screen power save bool ok = false; - const int disablePowerSave = qgetenv("QQNX_DISABLE_POWER_SAVE").toInt(&ok); + const int disablePowerSave = qEnvironmentVariableIntValue("QQNX_DISABLE_POWER_SAVE", &ok); if (ok && disablePowerSave) { const int mode = SCREEN_IDLE_MODE_KEEP_AWAKE; int result = screen_set_window_property_iv(window->nativeHandle(), SCREEN_PROPERTY_IDLE_MODE, &mode);