[rygel/wip/create-reference: 3/3] wip



commit 47a26dd39b945a79a8628be58a941c5a8dc28f8c
Author: Jens Georg <jensg openismus com>
Date:   Thu Feb 28 11:02:19 2013 +0100

    wip

 src/librygel-server/filelist.am                  |    1 +
 src/librygel-server/rygel-content-directory.vala |   10 ++++++++++
 src/librygel-server/rygel-reference-creator.vala |   18 ++++++++++++++++++
 3 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/src/librygel-server/filelist.am b/src/librygel-server/filelist.am
index 71d05c6..d0dfa3f 100644
--- a/src/librygel-server/filelist.am
+++ b/src/librygel-server/filelist.am
@@ -52,6 +52,7 @@ LIBRYGEL_SERVER_NONVAPI_SOURCE_FILES = \
        rygel-http-transcode-handler.vala \
        rygel-import-resource.vala \
        rygel-object-creator.vala \
+       rygel-reference-creator.vala \
        rygel-item-destroyer.vala \
        rygel-item-updater.vala \
        rygel-object-removal-queue.vala \
diff --git a/src/librygel-server/rygel-content-directory.vala 
b/src/librygel-server/rygel-content-directory.vala
index ecef0f4..8ac31b9 100644
--- a/src/librygel-server/rygel-content-directory.vala
+++ b/src/librygel-server/rygel-content-directory.vala
@@ -132,6 +132,8 @@ internal class Rygel.ContentDirectory: Service {
         this.action_invoked["Browse"].connect (this.browse_cb);
         this.action_invoked["Search"].connect (this.search_cb);
         this.action_invoked["CreateObject"].connect (this.create_object_cb);
+        this.action_invoked["CreateReference"].connect
+                                        (this.create_reference_cb);
         this.action_invoked["DestroyObject"].connect (this.destroy_object_cb);
         this.action_invoked["UpdateObject"].connect (this.update_object_cb);
         this.action_invoked["ImportResource"].connect (this.import_resource_cb);
@@ -208,6 +210,14 @@ internal class Rygel.ContentDirectory: Service {
         creator.run.begin ();
     }
 
+    /* CreateReference action implementation */
+    private void create_reference_cb (Service       content_dir,
+                                      ServiceAction action) {
+        var creator = new ReferenceCreator (this, action);
+
+        creator.run.begin ();
+    }
+
     /* DestroyObject action implementation */
     private void destroy_object_cb (Service       content_dir,
                                     ServiceAction action) {
diff --git a/src/librygel-server/rygel-reference-creator.vala 
b/src/librygel-server/rygel-reference-creator.vala
new file mode 100644
index 0000000..9f84796
--- /dev/null
+++ b/src/librygel-server/rygel-reference-creator.vala
@@ -0,0 +1,18 @@
+using GUPnP;
+
+internal class Rygel.ReferenceCreator : GLib.Object, Rygel.StateMachine {
+    private ServiceAction action;
+
+    // Props
+    public Cancellable cancellable { get; set; }
+
+    public ReferenceCreator (ContentDirectory    content_dir,
+                             owned ServiceAction action) {
+        this.cancellable = content_dir.cancellable;
+        this.action = (owned) action;
+    }
+
+    public async void run () {
+        Idle.add ( () => { this.action.return(); this.completed (); return false; } );
+    }
+}


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