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
parent
e8aa70c2d6
commit
d2ba9d0962
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue