core: HTTPItemURI gets HTTPServer reference
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Mon, 25 Jan 2010 16:28:00 +0000 (18:28 +0200)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Wed, 3 Feb 2010 13:38:48 +0000 (15:38 +0200)
HTTPItemURI gets reference to associated HTTPServer instance.

src/rygel/rygel-http-item-uri.vala
src/rygel/rygel-http-server.vala

index 1e8e798..3569d8a 100644 (file)
@@ -24,13 +24,16 @@ internal class Rygel.HTTPItemURI : Object {
     public string item_id;
     public int thumbnail_index;
     public string? transcode_target;
+    public HTTPServer http_server;
 
-    public HTTPItemURI (string item_id,
-                        int thumbnail_index = -1,
-                        string ? transcode_target = null) {
+    public HTTPItemURI (string     item_id,
+                        HTTPServer http_server,
+                        int        thumbnail_index = -1,
+                        string?    transcode_target = null) {
         this.item_id = item_id;
         this.thumbnail_index = thumbnail_index;
         this.transcode_target = transcode_target;
+        this.http_server = http_server;
     }
 
     public HTTPItemURI.from_string (string uri, string server_root = "") {
index 30e6b20..aac14d9 100644 (file)
@@ -125,7 +125,10 @@ internal class Rygel.HTTPServer : Rygel.TranscodeManager, Rygel.StateMachine {
     internal override string create_uri_for_item (MediaItem item,
                                                   int       thumbnail_index,
                                                   string?   transcode_target) {
-        var uri = new HTTPItemURI (item.id, thumbnail_index, transcode_target);
+        var uri = new HTTPItemURI (item.id,
+                                   this,
+                                   thumbnail_index,
+                                   transcode_target);
 
         return create_uri_for_path (uri.to_string());
     }