[gnome-control-center] info: Split the hostname setting



commit 1ce23f44d5d15ba870a723c5b53b0df384deea6d
Author: Bastien Nocera <hadess hadess net>
Date:   Sun Sep 18 13:49:07 2011 +0100

    info: Split the hostname setting
    
    Into a separate function.

 panels/info/cc-info-panel.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/panels/info/cc-info-panel.c b/panels/info/cc-info-panel.c
index ba3a15a..1d40561 100644
--- a/panels/info/cc-info-panel.c
+++ b/panels/info/cc-info-panel.c
@@ -1567,16 +1567,13 @@ info_panel_get_hostname (CcInfoPanel  *self)
 }
 
 static void
-text_changed_cb (GtkEntry        *entry,
-                 CcInfoPanel     *self)
+info_panel_set_hostname (CcInfoPanel *self,
+                         const char  *text)
 {
-  const char *text;
   char *hostname;
   GVariant *variant;
   GError *error = NULL;
 
-  text = gtk_entry_get_text (GTK_ENTRY (entry));
-
   variant = g_dbus_proxy_call_sync (self->priv->hostnamed_proxy,
                                     "SetPrettyHostname",
                                     g_variant_new ("(sb)", text, FALSE),
@@ -1614,6 +1611,16 @@ text_changed_cb (GtkEntry        *entry,
 }
 
 static void
+text_changed_cb (GtkEntry        *entry,
+                 CcInfoPanel     *self)
+{
+  const char *text;
+
+  text = gtk_entry_get_text (GTK_ENTRY (entry));
+  info_panel_set_hostname (self, text);
+}
+
+static void
 info_panel_setup_hostname (CcInfoPanel  *self,
                            GPermission  *permission)
 {



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