summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2011-03-24 16:17:17 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2011-03-24 16:17:17 (GMT)
commit116fed06f9ed561befb505d94b6b44dc71bf9e45 (patch)
tree1c758431a36e350b13509beb50d1cac336a702c6 /src
parent7e50de65d564d69d28a73fee3c65dd0a92bf3f53 (diff)
downloadQt-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')
-rw-r--r--src/corelib/tools/qlocale_mac.mm4
-rw-r--r--src/corelib/tools/qlocale_unix.cpp4
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));
}