From edb2e6d624373b748e3c027e04b8bb4303b78476 Mon Sep 17 00:00:00 2001 From: nowrep Date: Tue, 10 Jul 2012 22:26:59 +0200 Subject: [PATCH] Preferences: Fixed showing current language twice in list. --- src/lib/preferences/preferences.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/preferences/preferences.cpp b/src/lib/preferences/preferences.cpp index 85dc69e96..c95259d30 100644 --- a/src/lib/preferences/preferences.cpp +++ b/src/lib/preferences/preferences.cpp @@ -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());