[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)
main
Adriaan de Groot 5 years ago
parent 97f622e094
commit 49690fc681

@ -71,23 +71,6 @@ LocaleConfiguration::fromLanguageAndLocation( const QString& languageLocale,
{
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

Loading…
Cancel
Save