QGestureManager: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster than qgetenv(). Change-Id: I863593166db8eff4c4466996110f5cfdb758ec00 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
parent
948e88dab2
commit
037ba8d7af
@ -66,7 +66,7 @@ static inline int panTouchPoints()
|
|||||||
static const char panTouchPointVariable[] = "QT_PAN_TOUCHPOINTS";
|
static const char panTouchPointVariable[] = "QT_PAN_TOUCHPOINTS";
|
||||||
if (qEnvironmentVariableIsSet(panTouchPointVariable)) {
|
if (qEnvironmentVariableIsSet(panTouchPointVariable)) {
|
||||||
bool ok;
|
bool ok;
|
||||||
const int result = qgetenv(panTouchPointVariable).toInt(&ok);
|
const int result = qEnvironmentVariableIntValue(panTouchPointVariable, &ok);
|
||||||
if (ok && result >= 1)
|
if (ok && result >= 1)
|
||||||
return result;
|
return result;
|
||||||
qWarning() << "Ignoring invalid value of " << panTouchPointVariable;
|
qWarning() << "Ignoring invalid value of " << panTouchPointVariable;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user