diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2011-03-24 16:17:17 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2011-03-24 16:17:17 (GMT) |
commit | 116fed06f9ed561befb505d94b6b44dc71bf9e45 (patch) | |
tree | 1c758431a36e350b13509beb50d1cac336a702c6 /src/corelib/tools | |
parent | 7e50de65d564d69d28a73fee3c65dd0a92bf3f53 (diff) | |
download | Qt-116fed06f9ed561befb505d94b6b44dc71bf9e45.zip Qt-116fed06f9ed561befb505d94b6b44dc71bf9e45.tar.gz Qt-116fed06f9ed561befb505d94b6b44dc71bf9e45.tar.bz2 |
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
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qlocale_mac.mm | 4 | ||||
-rw-r--r-- | 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)); } |