[gnome-control-center] region: Remove duplicate cancellable code



commit f036b3a7064b1fcb690ee048b03b28b706ceae2d
Author: Robert Ancell <robert ancell canonical com>
Date:   Mon Sep 10 15:51:53 2018 +1200

    region: Remove duplicate cancellable code
    
    There was a GCancellable used for IBus operations that was generated each time
    an operation was done. The cancellable was only used to cancel such operations
    when the panel is closed. We can just use the shared cancellable for this.

 panels/region/cc-region-panel.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
---
diff --git a/panels/region/cc-region-panel.c b/panels/region/cc-region-panel.c
index 1f107531b..8d04cea0d 100644
--- a/panels/region/cc-region-panel.c
+++ b/panels/region/cc-region-panel.c
@@ -115,7 +115,6 @@ struct _CcRegionPanel {
 #ifdef HAVE_IBUS
         IBusBus *ibus;
         GHashTable *ibus_engines;
-        GCancellable *ibus_cancellable;
 #endif
 };
 
@@ -148,9 +147,6 @@ cc_region_panel_finalize (GObject *object)
         g_clear_object (&self->xkb_info);
 #ifdef HAVE_IBUS
         g_clear_object (&self->ibus);
-        if (self->ibus_cancellable)
-                g_cancellable_cancel (self->ibus_cancellable);
-        g_clear_object (&self->ibus_cancellable);
         g_clear_pointer (&self->ibus_engines, g_hash_table_destroy);
 #endif
         g_free (self->language);
@@ -668,8 +664,6 @@ fetch_ibus_engines_result (GObject       *object,
                 return;
         }
 
-        g_clear_object (&self->ibus_cancellable);
-
         /* Maps engine ids to engine description objects */
         self->ibus_engines = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref);
 
@@ -690,11 +684,9 @@ fetch_ibus_engines_result (GObject       *object,
 static void
 fetch_ibus_engines (CcRegionPanel *self)
 {
-        self->ibus_cancellable = g_cancellable_new ();
-
         ibus_bus_list_engines_async (self->ibus,
                                      -1,
-                                     self->ibus_cancellable,
+                                     self->cancellable,
                                      (GAsyncReadyCallback)fetch_ibus_engines_result,
                                      self);
 


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