[gnome-control-center] sharing: Make use of the cancellable for async hostname calls



commit 2556fd5e2c177010bf4871753f4476e4f80193f0
Author: Rui Matos <tiagomatos gmail com>
Date:   Tue Aug 29 18:00:54 2017 +0200

    sharing: Make use of the cancellable for async hostname calls
    
    We have it initialized and disposed and the async calls already handle
    being cancelled. We just forgot to actually use it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786984

 panels/sharing/cc-sharing-panel.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c
index a557ad4..5add115 100644
--- a/panels/sharing/cc-sharing-panel.c
+++ b/panels/sharing/cc-sharing-panel.c
@@ -786,7 +786,7 @@ cc_sharing_panel_bus_ready (GObject         *object,
                           (GVariantType*)"(s)",
                           G_DBUS_CALL_FLAGS_NONE,
                           -1,
-                          NULL,
+                          data->panel->priv->hostname_cancellable,
                           (GAsyncReadyCallback) cc_sharing_panel_get_host_name_fqdn_done,
                           data);
 }
@@ -824,7 +824,8 @@ cc_sharing_panel_setup_label_with_hostname (CcSharingPanel *self,
   get_hostname_data = g_new (GetHostNameData, 1);
   get_hostname_data->panel = self;
   get_hostname_data->label = label;
-  g_bus_get (G_BUS_TYPE_SYSTEM, NULL,
+  g_bus_get (G_BUS_TYPE_SYSTEM,
+             self->priv->hostname_cancellable,
              (GAsyncReadyCallback) cc_sharing_panel_bus_ready,
              get_hostname_data);
 }


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