[locale] Remove superfluous code

- the list is already filtered for UTF-8, so this is redundant
 - this *incidentally* fixes the problem with Assamese and Asturian,
   since Assamese (as_IN) was having its only entry removed,
   after which it would match Asturian (ast_ES)
This commit is contained in:
Adriaan de Groot 2020-01-28 16:01:59 +01:00
parent 97f622e094
commit 49690fc681

View File

@ -71,23 +71,6 @@ LocaleConfiguration::fromLanguageAndLocation( const QString& languageLocale,
{ {
lang = linesForLanguage.first(); lang = linesForLanguage.first();
} }
else
{
QStringList linesForLanguageUtf;
// FIXME: this might be useless if we already filter out non-UTF8 locales
foreach ( QString line, linesForLanguage )
{
if ( line.contains( "UTF-8", Qt::CaseInsensitive ) || line.contains( "utf8", Qt::CaseInsensitive ) )
{
linesForLanguageUtf.append( line );
}
}
if ( linesForLanguageUtf.length() == 1 )
{
lang = linesForLanguageUtf.first();
}
}
// lang could still be empty if we found multiple locales that satisfy myLanguage // lang could still be empty if we found multiple locales that satisfy myLanguage