Include QLocale::system() in matchingLocales() return list
QLocale::matchingLocales() only returns matches from the CLDR database, it does not include the current system locale as a match, even if it does match. Add the current system locale, if it matches. Task-number: QTBUG-106644 Change-Id: If2e409bf0fd8582941646838330e36b79952d3f6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>bb10
parent
94c16517b3
commit
916008a50d
|
|
@ -2748,6 +2748,15 @@ QList<QLocale> QLocale::matchingLocales(QLocale::Language language, QLocale::Scr
|
|||
++index;
|
||||
}
|
||||
|
||||
// Add current system locale, if it matches
|
||||
const auto syslocaledata = systemData();
|
||||
|
||||
if (filter.acceptLanguage(syslocaledata->m_language_id)) {
|
||||
const QLocaleId id = syslocaledata->id();
|
||||
if (filter.acceptScriptTerritory(id))
|
||||
result.append(QLocale::system());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue