[gnome-control-center/wip/feborges/new-remote-desktop-dialog: 9/11] fixup! sharing: Port Screen Sharing dialog to RDP
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/feborges/new-remote-desktop-dialog: 9/11] fixup! sharing: Port Screen Sharing dialog to RDP
- Date: Fri, 25 Feb 2022 20:14:36 +0000 (UTC)
commit 8a2d543b81ba335062490e46e70db253785676b4
Author: Jonas Ådahl <jadahl gmail com>
Date: Fri Feb 25 19:01:45 2022 +0100
fixup! sharing: Port Screen Sharing dialog to RDP
panels/sharing/cc-sharing-panel.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
---
diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c
index 878346440..8ec246722 100644
--- a/panels/sharing/cc-sharing-panel.c
+++ b/panels/sharing/cc-sharing-panel.c
@@ -1232,6 +1232,7 @@ get_hostname (void)
g_autoptr(GVariant) res = NULL;
g_autoptr(GVariant) inner = NULL;
g_autoptr(GError) error = NULL;
+ const char *hostname;
bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
if (bus == NULL)
@@ -1259,6 +1260,34 @@ get_hostname (void)
return NULL;
}
+ g_variant_get (res, "(v)", &inner);
+ hostname = g_variant_get_string (inner, NULL);
+ if (g_strcmp0 (hostname, "") != 0)
+ return g_strdup (hostname);
+
+ g_clear_pointer (&inner, g_variant_unref);
+ g_clear_pointer (&res, g_variant_unref);
+
+ res = g_dbus_connection_call_sync (bus,
+ "org.freedesktop.hostname1",
+ "/org/freedesktop/hostname1",
+ "org.freedesktop.DBus.Properties",
+ "Get",
+ g_variant_new ("(ss)",
+ "org.freedesktop.hostname1",
+ "Hostname"),
+ (GVariantType*)"(v)",
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL,
+ &error);
+
+ if (res == NULL)
+ {
+ g_warning ("Getting hostname failed: %s", error->message);
+ return NULL;
+ }
+
g_variant_get (res, "(v)", &inner);
return g_variant_dup_string (inner, NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]