1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 12:46:35 +01:00

Preferences: Fixed showing current language twice in list.

This commit is contained in:
nowrep 2012-07-10 22:26:59 +02:00
parent 11972affaf
commit edb2e6d624

View File

@ -346,7 +346,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
//OTHER //OTHER
//Languages //Languages
QString activeLanguage = ""; QString activeLanguage;
if (!mApp->currentLanguage().isEmpty()) { if (!mApp->currentLanguage().isEmpty()) {
activeLanguage = mApp->currentLanguage(); activeLanguage = mApp->currentLanguage();
QLocale locale(activeLanguage); QLocale locale(activeLanguage);
@ -359,12 +359,17 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
QDir lanDir(mApp->TRANSLATIONSDIR); QDir lanDir(mApp->TRANSLATIONSDIR);
QStringList list = lanDir.entryList(QStringList("*.qm")); QStringList list = lanDir.entryList(QStringList("*.qm"));
foreach(const QString & name, list) { foreach(const QString & name, list) {
if (name.startsWith("qt_") || name == activeLanguage) { if (name.startsWith("qt_")) {
continue; continue;
} }
QString loc = name; QString loc = name;
loc.remove(".qm"); loc.remove(".qm");
if (loc == activeLanguage) {
continue;
}
QLocale locale(loc); QLocale locale(loc);
QString country = QLocale::countryToString(locale.country()); QString country = QLocale::countryToString(locale.country());
QString language = QLocale::languageToString(locale.language()); QString language = QLocale::languageToString(locale.language());