From 116fed06f9ed561befb505d94b6b44dc71bf9e45 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Thu, 24 Mar 2011 17:17:17 +0100 Subject: Use QByteArray::isEmpty instead of isNull in QLocale When checking whether the environment variable is set or not, check for its length by using isEmpty as the envvar can be set to an empty string. Task-number: QTBUG-15321 Reviewed-by: Zeno Albisser --- src/corelib/tools/qlocale_mac.mm | 4 ++-- src/corelib/tools/qlocale_unix.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/tools/qlocale_mac.mm b/src/corelib/tools/qlocale_mac.mm index c824ec0..172997d 100644 --- a/src/corelib/tools/qlocale_mac.mm +++ b/src/corelib/tools/qlocale_mac.mm @@ -61,9 +61,9 @@ static QByteArray envVarLocale() static QByteArray lang = 0; #ifdef Q_OS_UNIX lang = qgetenv("LC_ALL"); - if (lang.isNull()) + if (lang.isEmpty()) lang = qgetenv("LC_NUMERIC"); - if (lang.isNull()) + if (lang.isEmpty()) #endif lang = qgetenv("LANG"); return lang; diff --git a/src/corelib/tools/qlocale_unix.cpp b/src/corelib/tools/qlocale_unix.cpp index 21097bf..40a52ba 100644 --- a/src/corelib/tools/qlocale_unix.cpp +++ b/src/corelib/tools/qlocale_unix.cpp @@ -94,9 +94,9 @@ Q_GLOBAL_STATIC(QSystemLocaleData, qSystemLocaleData) QLocale QSystemLocale::fallbackLocale() const { QByteArray lang = qgetenv("LC_ALL"); - if (lang.isNull()) + if (lang.isEmpty()) lang = qgetenv("LC_NUMERIC"); - if (lang.isNull()) + if (lang.isEmpty()) lang = qgetenv("LANG"); return QLocale(QLatin1String(lang)); } -- cgit v0.12