[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/runtime/kcontrol/locale
From: Albert Astals Cid <tsdgeos () terra ! es>
Date: 2010-09-26 23:22:20
Message-ID: 20100926232220.61041AC857 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1180088 by aacid:
warn the user if a language he has set for use has is not possible to be used and \
also remove it from the list since it doesn't make sense to have it there
M +25 -1 kcmlocale.cpp
--- trunk/KDE/kdebase/runtime/kcontrol/locale/kcmlocale.cpp #1180087:1180088
@@ -30,6 +30,7 @@
#include <KDebug>
#include <KConfig>
#include <KConfigGroup>
+#include <KMessageBox>
#include <KStandardDirs>
#include "kcmlocale.moc"
@@ -211,8 +212,31 @@
{
// update language widget
m_languages->clear();
+ QStringList brokenLangs;
foreach (const QString& langCode, m_languageList)
- m_languages->addItem(readLocale(m_locale->language(),langCode));
+ {
+ const QString langName = readLocale(m_locale->language(),langCode);
+ if (!langName.isEmpty())
+ {
+ m_languages->addItem(langName);
+ }
+ else
+ {
+ brokenLangs << langCode;
+ }
+ }
+ if (!brokenLangs.isEmpty())
+ {
+ foreach (const QString& brokenLang, brokenLangs)
+ {
+ KMessageBox::information(this, i18n("You have the language with code \"%1\" in \
your list of languages to use for translation " + \
"but the localization files for it could not be found. The language has been removed \
from " + "your configuration. If you want \
to add it again please install the localization files " + \
"for it and add the language again.", brokenLang)); + m_languageList.removeAll \
(brokenLang); + }
+ save ();
+ }
slotCheckButtons();
QString country = m_locale->countryCodeToName(m_locale->country());
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic