[gnome-control-center] Add a cancellable to the page base class



commit 5918f585333d012e62efd8f8f9499259949866d1
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Mar 4 21:38:40 2013 -0500

    Add a cancellable to the page base class
    
    This will be used for firewall setup.

 panels/network/connection-editor/ce-page.c |    5 +++++
 panels/network/connection-editor/ce-page.h |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/panels/network/connection-editor/ce-page.c b/panels/network/connection-editor/ce-page.c
index a82927c..f5caa32 100644
--- a/panels/network/connection-editor/ce-page.c
+++ b/panels/network/connection-editor/ce-page.c
@@ -79,6 +79,10 @@ finalize (GObject *object)
         CEPage *self = CE_PAGE (object);
 
         g_free (self->title);
+        if (self->cancellable) {
+                g_cancellable_cancel (self->cancellable);
+                g_object_unref (self->cancellable);
+        }
 
         G_OBJECT_CLASS (ce_page_parent_class)->finalize (object);
 }
@@ -160,6 +164,7 @@ static void
 ce_page_init (CEPage *self)
 {
         self->builder = gtk_builder_new ();
+        self->cancellable = g_cancellable_new ();
 }
 
 static void
diff --git a/panels/network/connection-editor/ce-page.h b/panels/network/connection-editor/ce-page.h
index 8e3ed80..036ddfa 100644
--- a/panels/network/connection-editor/ce-page.h
+++ b/panels/network/connection-editor/ce-page.h
@@ -55,6 +55,7 @@ struct _CEPage
         NMConnection *connection;
         NMClient *client;
         NMRemoteSettings *settings;
+        GCancellable *cancellable;
 };
 
 struct _CEPageClass


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