[gnome-control-center/gnome-3-8] region: Fix setting the system language



commit 29e96e4b12becda176d867bef1cb23acbd8101e5
Author: Rui Matos <tiagomatos gmail com>
Date:   Tue Apr 9 01:21:31 2013 +0200

    region: Fix setting the system language
    
    We need to actually change the variable holding the system language so
    that it gets applied.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694922

 panels/region/cc-region-panel.c |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/panels/region/cc-region-panel.c b/panels/region/cc-region-panel.c
index 6431f2d..83c8946 100644
--- a/panels/region/cc-region-panel.c
+++ b/panels/region/cc-region-panel.c
@@ -356,21 +356,34 @@ maybe_notify (CcRegionPanel *self,
 static void set_localed_locale (CcRegionPanel *self);
 
 static void
+set_system_language (CcRegionPanel *self,
+                     const gchar   *language)
+{
+        CcRegionPanelPrivate *priv = self->priv;
+
+        if (g_strcmp0 (language, priv->system_language) == 0)
+                return;
+
+        g_free (priv->system_language);
+        priv->system_language = g_strdup (language);
+
+        set_localed_locale (self);
+}
+
+static void
 update_language (CcRegionPanel *self,
                  const gchar   *language)
 {
        CcRegionPanelPrivate *priv = self->priv;
 
         if (priv->login) {
-                if (g_strcmp0 (language, priv->system_language) == 0)
-                        return;
-                set_localed_locale (self);
+                set_system_language (self, language);
         } else {
                 if (g_strcmp0 (language, priv->language) == 0)
                         return;
                 act_user_set_language (priv->user, language);
                 if (priv->login_auto_apply)
-                        set_localed_locale (self);
+                        set_system_language (self, language);
                 maybe_notify (self, LC_MESSAGES, language);
         }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]