Correctly allow to choose from multiple localizations for the same language, but different dialect in Preferences.

This commit is contained in:
Konstantin Isakov 2011-03-03 23:11:29 -08:00
parent caf21a0e8a
commit 905c6cd450

View file

@ -57,9 +57,11 @@ Preferences::Preferences( QWidget * parent, Config::Preferences const & p ):
if ( lang == "qt" )
continue; // We skip qt's own localizations
sortedLocs[ Language::localizedNameForId( LangCoder::code2toInt( lang.toAscii().data() ) ) ]
= QPair< QIcon, QString >( QIcon( QString( ":/flags/%1.png" ).arg( i->mid( 3, 2 ).toLower() ) ),
i->mid( 0, i->size() - 3 ) );
sortedLocs.insertMulti(
Language::localizedNameForId( LangCoder::code2toInt( lang.toAscii().data() ) ),
QPair< QIcon, QString >(
QIcon( QString( ":/flags/%1.png" ).arg( i->mid( 3, 2 ).toLower() ) ),
i->mid( 0, i->size() - 3 ) ) );
}
for( QMap< QString, QPair< QIcon, QString > >::iterator i = sortedLocs.begin();