info: Split the hostname setting
Into a separate function.
This commit is contained in:
parent
97af2049fd
commit
1ce23f44d5
1 changed files with 12 additions and 5 deletions
|
@ -1567,16 +1567,13 @@ info_panel_get_hostname (CcInfoPanel *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
text_changed_cb (GtkEntry *entry,
|
info_panel_set_hostname (CcInfoPanel *self,
|
||||||
CcInfoPanel *self)
|
const char *text)
|
||||||
{
|
{
|
||||||
const char *text;
|
|
||||||
char *hostname;
|
char *hostname;
|
||||||
GVariant *variant;
|
GVariant *variant;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
text = gtk_entry_get_text (GTK_ENTRY (entry));
|
|
||||||
|
|
||||||
variant = g_dbus_proxy_call_sync (self->priv->hostnamed_proxy,
|
variant = g_dbus_proxy_call_sync (self->priv->hostnamed_proxy,
|
||||||
"SetPrettyHostname",
|
"SetPrettyHostname",
|
||||||
g_variant_new ("(sb)", text, FALSE),
|
g_variant_new ("(sb)", text, FALSE),
|
||||||
|
@ -1613,6 +1610,16 @@ text_changed_cb (GtkEntry *entry,
|
||||||
g_free (hostname);
|
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
|
static void
|
||||||
info_panel_setup_hostname (CcInfoPanel *self,
|
info_panel_setup_hostname (CcInfoPanel *self,
|
||||||
GPermission *permission)
|
GPermission *permission)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue