1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +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
//Languages
QString activeLanguage = "";
QString activeLanguage;
if (!mApp->currentLanguage().isEmpty()) {
activeLanguage = mApp->currentLanguage();
QLocale locale(activeLanguage);
@ -359,12 +359,17 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
QDir lanDir(mApp->TRANSLATIONSDIR);
QStringList list = lanDir.entryList(QStringList("*.qm"));
foreach(const QString & name, list) {
if (name.startsWith("qt_") || name == activeLanguage) {
if (name.startsWith("qt_")) {
continue;
}
QString loc = name;
loc.remove(".qm");
if (loc == activeLanguage) {
continue;
}
QLocale locale(loc);
QString country = QLocale::countryToString(locale.country());
QString language = QLocale::languageToString(locale.language());