summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2012-03-21 10:03:26 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-22 13:29:50 +0100
commitf89bf2c15354729c5615209588c235e5eb311c0f (patch)
treedbee74414d79bca06cf75987c947a34427029365 /src
parent5ec5ce354904d35c013512a1d38c24502e298657 (diff)
Make comment() work in the C locale too.
The parser makes the default language en_US, and no mimetype xml says <comment xml:lang="C">, so use the en_US string for the C locale, rather than returning an empty string. Change-Id: Iad7c142e8078abe357773249416e7ce9b3e29a92 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/mimetypes/qmimetype.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/mimetypes/qmimetype.cpp b/src/corelib/mimetypes/qmimetype.cpp
index 18ce5e5000..ea10cbe70a 100644
--- a/src/corelib/mimetypes/qmimetype.cpp
+++ b/src/corelib/mimetypes/qmimetype.cpp
@@ -282,7 +282,8 @@ QString QMimeType::comment() const
QStringList languageList;
languageList << QLocale::system().name();
languageList << QLocale::system().uiLanguages();
- Q_FOREACH (const QString &lang, languageList) {
+ Q_FOREACH (const QString &language, languageList) {
+ const QString lang = language == QLatin1String("C") ? QLatin1String("en_US") : language;
const QString comm = d->localeComments.value(lang);
if (!comm.isEmpty())
return comm;