locale: Move the string processing out of the loop.

This commit is contained in:
Kevin Kofler 2014-11-26 17:12:18 +01:00
parent 88dfd7fa10
commit b79618aa15

View File

@ -298,10 +298,11 @@ LocalePage::guessLCLocale()
if ( m_localeGenLines.isEmpty() )
return "en_US.UTF-8 UTF-8";
QString myLanguage = myLocale.name().split( '_' ).first();
QStringList linesForLanguage;
foreach ( QString line, m_localeGenLines )
{
if ( line.startsWith( myLocale.name().split( '_' ).first() ) )
if ( line.startsWith( myLanguage ) )
linesForLanguage.append( line );
}