[rygel] core: ImportResource keeps its own Cancellable object



commit d9963e88542f2b01179a4117f3787de1f85a94d9
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Fri Feb 19 14:16:22 2010 +0200

    core: ImportResource keeps its own Cancellable object

 src/rygel/rygel-import-resource.vala |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/rygel/rygel-import-resource.vala b/src/rygel/rygel-import-resource.vala
index e14f420..e80af8a 100644
--- a/src/rygel/rygel-import-resource.vala
+++ b/src/rygel/rygel-import-resource.vala
@@ -73,7 +73,7 @@ internal class Rygel.ImportResource : GLib.Object, Rygel.StateMachine {
                            owned ServiceAction action) {
         this.root_container = content_dir.root_container;
         this.http_server = content_dir.http_server;
-        this.cancellable = content_dir.cancellable;
+        this.cancellable = new Cancellable ();
         this.action = (owned) action;
 
         last_transfer_id++;
@@ -83,6 +83,10 @@ internal class Rygel.ImportResource : GLib.Object, Rygel.StateMachine {
         this.bytes_total = 0;
 
         this.status = TransferStatus.IN_PROGRESS;
+
+        content_dir.cancellable.cancelled.connect (() => {
+            this.cancellable.cancel ();
+        });
     }
 
     public async void run () {



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