QIcon: use qEnvironmentVariableIsEmpty()

It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I427aa5bf5b8d76aabdd5ce5950e9e6762f79b8d8
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
bb10
Marc Mutz 2014-09-07 21:22:27 +02:00
parent e8aa70c2d6
commit d2ba9d0962
1 changed files with 1 additions and 1 deletions

View File

@ -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) {