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>
This commit is contained in:
parent
5ec5ce3549
commit
f89bf2c153
@ -282,7 +282,8 @@ QString QMimeType::comment() const
|
|||||||
QStringList languageList;
|
QStringList languageList;
|
||||||
languageList << QLocale::system().name();
|
languageList << QLocale::system().name();
|
||||||
languageList << QLocale::system().uiLanguages();
|
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);
|
const QString comm = d->localeComments.value(lang);
|
||||||
if (!comm.isEmpty())
|
if (!comm.isEmpty())
|
||||||
return comm;
|
return comm;
|
||||||
|
@ -56,7 +56,7 @@ static const char yastFileName[] ="yast2-metapackage-handler-mimetypes.xml";
|
|||||||
void initializeLang()
|
void initializeLang()
|
||||||
{
|
{
|
||||||
qputenv("LC_ALL", "");
|
qputenv("LC_ALL", "");
|
||||||
qputenv("LANG", "en_US");
|
qputenv("LANG", "C");
|
||||||
QCoreApplication::setApplicationName("tst_qmimedatabase"); // temporary directory pattern
|
QCoreApplication::setApplicationName("tst_qmimedatabase"); // temporary directory pattern
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user