File tree 1 file changed +4
-7
lines changed
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -417,15 +417,12 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
417
417
foreach ( QString l, myI18nList )
418
418
{
419
419
#if QT_VERSION >= 0x040800
420
- cboLocale->addItem ( QIcon ( QString ( " :/images/flags/%1.png" ).arg ( l ) ), QLocale ( l ).nativeLanguageName () );
420
+ cboLocale->addItem ( QIcon ( QString ( " :/images/flags/%1.png" ).arg ( l ) ), QLocale ( l ).nativeLanguageName (), l );
421
421
#else
422
- cboLocale->addItem ( QIcon ( QString ( " :/images/flags/%1.png" ).arg ( l ) ), l );
422
+ cboLocale->addItem ( QIcon ( QString ( " :/images/flags/%1.png" ).arg ( l ) ), l, l );
423
423
#endif
424
424
}
425
- if ( myI18nList.contains ( myUserLocale ) )
426
- {
427
- cboLocale->setCurrentIndex ( myI18nList.indexOf ( myUserLocale ) );
428
- }
425
+ cboLocale->setCurrentIndex ( cboLocale->findData ( myUserLocale ) );
429
426
bool myLocaleOverrideFlag = settings.value ( " locale/overrideFlag" , false ).toBool ();
430
427
grpLocale->setChecked ( myLocaleOverrideFlag );
431
428
@@ -909,7 +906,7 @@ void QgsOptions::saveOptions()
909
906
//
910
907
// Locale settings
911
908
//
912
- settings.setValue ( " locale/userLocale" , cboLocale->currentText () );
909
+ settings.setValue ( " locale/userLocale" , cboLocale->itemData ( cboLocale-> currentIndex () ). toString () );
913
910
settings.setValue ( " locale/overrideFlag" , grpLocale->isChecked () );
914
911
915
912
You can’t perform that action at this time.
0 commit comments