From 1ce23f44d5d15ba870a723c5b53b0df384deea6d Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Sun, 18 Sep 2011 13:49:07 +0100 Subject: [PATCH] info: Split the hostname setting Into a separate function. --- panels/info/cc-info-panel.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/panels/info/cc-info-panel.c b/panels/info/cc-info-panel.c index ba3a15a0e..1d405618e 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), @@ -1613,6 +1610,16 @@ text_changed_cb (GtkEntry *entry, g_free (hostname); } +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)