QtWidgets: use new qEnvironmentVariableIs{Empty,Set}()

Incidentally, this patch shows that Qt isn't consistent in how it
treats empty environment variables used as flags, but that is something
for a separate commit. This patch aims to be behaviour-preserving.

Change-Id: I5390cda314858762b76384291373a6f0167d323a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Marc Mutz 2012-08-07 00:14:45 +02:00 committed by Qt by Nokia
parent 146b7a9c8b
commit 4fa544c8cd
2 changed files with 5 additions and 5 deletions

View File

@ -2113,7 +2113,7 @@ void QGraphicsAnchorLayoutPrivate::calculateGraphs(
lastCalculationUsedSimplex[orientation] = false;
#endif
static bool simplificationEnabled = qgetenv("QT_ANCHORLAYOUT_NO_SIMPLIFICATION").isEmpty();
static bool simplificationEnabled = qEnvironmentVariableIsEmpty("QT_ANCHORLAYOUT_NO_SIMPLIFICATION");
// Reset the nominal sizes of each anchor based on the current item sizes
refreshAllSizeHints(orientation);

View File

@ -1064,10 +1064,10 @@ static QAquaWidgetSize qt_aqua_guess_size(const QWidget *widg, QSize large, QSiz
}
#ifndef QT_NO_MAINWINDOW
if (qobject_cast<QDockWidget *>(widg->window()) || !qgetenv("QWIDGET_ALL_SMALL").isNull()) {
if (qobject_cast<QDockWidget *>(widg->window()) || qEnvironmentVariableIsSet("QWIDGET_ALL_SMALL")) {
//if (small.width() != -1 || small.height() != -1)
return QAquaSizeSmall;
} else if (!qgetenv("QWIDGET_ALL_MINI").isNull()) {
} else if (qEnvironmentVariableIsSet("QWIDGET_ALL_MINI")) {
return QAquaSizeMini;
}
#endif
@ -1126,9 +1126,9 @@ QAquaWidgetSize QMacStylePrivate::aquaSizeConstrain(const QStyleOption *option,
if (!widg) {
if (insz)
*insz = QSize();
if (!qgetenv("QWIDGET_ALL_SMALL").isNull())
if (qEnvironmentVariableIsSet("QWIDGET_ALL_SMALL"))
return QAquaSizeSmall;
if (!qgetenv("QWIDGET_ALL_MINI").isNull())
if (qEnvironmentVariableIsSet("QWIDGET_ALL_MINI"))
return QAquaSizeMini;
return QAquaSizeUnknown;
}