summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamarque V. Souza <lamarque@kde.org>2011-12-21 15:11:57 (GMT)
committerSebastian Trueg <trueg@kde.org>2012-01-27 13:16:32 (GMT)
commit87756493f51716594c5ad40f29a5c92ee66e0425 (patch)
treec1c2dd869f32ddd2ec50526359242cdfdd7c7421
parentfcbac39a6f8906cd669a4e2b98191cb26d67fa40 (diff)
Make KGlobalSettings reread locale settings before calling
settingsChanged(). CCBUG: 289094 REVIEW: 103469
-rw-r--r--kdecore/localization/klocale.cpp5
-rw-r--r--kdecore/localization/klocale.h8
-rw-r--r--kdecore/localization/klocale_p.h10
-rw-r--r--kdeui/kernel/kglobalsettings.cpp4
-rw-r--r--kdeui/kernel/kglobalsettings.h3
5 files changed, 24 insertions, 6 deletions
diff --git a/kdecore/localization/klocale.cpp b/kdecore/localization/klocale.cpp
index 499bf11..02aa77a 100644
--- a/kdecore/localization/klocale.cpp
+++ b/kdecore/localization/klocale.cpp
@@ -780,3 +780,8 @@ KLocale::DigitSet KLocale::dateTimeDigitSet() const
{
return d->dateTimeDigitSet();
}
+
+void KLocale::reparseConfiguration()
+{
+ d->initFormat();
+}
diff --git a/kdecore/localization/klocale.h b/kdecore/localization/klocale.h
index 3495431..3a05b5e 100644
--- a/kdecore/localization/klocale.h
+++ b/kdecore/localization/klocale.h
@@ -2114,6 +2114,14 @@ public:
QString convertDigits(const QString &str, DigitSet digitSet,
bool ignoreContext = false) const;
+ /**
+ * @since 4.8
+ *
+ * Reparse locale configuration files for the current selected
+ * language.
+ */
+ void reparseConfiguration();
+
private:
friend class KLocalePrivate;
friend class KLocaleTest;
diff --git a/kdecore/localization/klocale_p.h b/kdecore/localization/klocale_p.h
index 4ed8e3f..af4a768 100644
--- a/kdecore/localization/klocale_p.h
+++ b/kdecore/localization/klocale_p.h
@@ -63,6 +63,11 @@ public:
** Initialization **
**************************/
+ /**
+ * Reads the format configuration from disk.
+ */
+ virtual void initFormat();
+
protected:
/**
@@ -76,11 +81,6 @@ protected:
virtual void copy(const KLocalePrivate &rhs);
/**
- * @internal Reads the format configuration from disk.
- */
- virtual void initFormat();
-
- /**
* @internal Main init function, needs to be called by appropriate child constructor.
*/
virtual void init(const QString& catalogName, const QString &language, const QString &country,
diff --git a/kdeui/kernel/kglobalsettings.cpp b/kdeui/kernel/kglobalsettings.cpp
index 819b314..6f26582 100644
--- a/kdeui/kernel/kglobalsettings.cpp
+++ b/kdeui/kernel/kglobalsettings.cpp
@@ -24,6 +24,7 @@
#include <kdebug.h>
#include <kglobal.h>
+#include <klocale.h>
#include <kstandarddirs.h>
#include <kprotocolinfo.h>
#include <kcolorscheme.h>
@@ -882,6 +883,9 @@ void KGlobalSettings::Private::_k_slotNotifyChange(int changeType, int arg)
propagateQtSettings();
}
} else {
+ if (category == SETTINGS_LOCALE) {
+ KGlobal::locale()->reparseConfiguration();
+ }
emit q->settingsChanged(category);
}
break;
diff --git a/kdeui/kernel/kglobalsettings.h b/kdeui/kernel/kglobalsettings.h
index cb8f7e2..6b76146 100644
--- a/kdeui/kernel/kglobalsettings.h
+++ b/kdeui/kernel/kglobalsettings.h
@@ -591,7 +591,8 @@ public:
* Valid values for the settingsChanged signal
*/
enum SettingsCategory { SETTINGS_MOUSE, SETTINGS_COMPLETION, SETTINGS_PATHS,
- SETTINGS_POPUPMENU, SETTINGS_QT, SETTINGS_SHORTCUTS };
+ SETTINGS_POPUPMENU, SETTINGS_QT, SETTINGS_SHORTCUTS,
+ SETTINGS_LOCALE };
Q_SIGNALS:
/**