[rygel] media-export: More removal of cache parameters.



commit 9e0af2701acd103cf1b0d8d93fb827f82c97a484
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Jan 17 14:39:30 2013 +0100

    media-export: More removal of cache parameters.

 .../rygel-media-export-media-cache.vala            |    5 ++---
 .../rygel-media-export-node-query-container.vala   |    6 ++----
 .../rygel-media-export-object-factory.vala         |    8 +++-----
 ...rygel-media-export-query-container-factory.vala |   10 +++-------
 .../rygel-media-export-root-container.vala         |   10 ++++------
 5 files changed, 14 insertions(+), 25 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-media-cache.vala b/src/plugins/media-export/rygel-media-export-media-cache.vala
index aaa57a2..2af35f6 100644
--- a/src/plugins/media-export/rygel-media-export-media-cache.vala
+++ b/src/plugins/media-export/rygel-media-export-media-cache.vala
@@ -689,7 +689,7 @@ public class Rygel.MediaExport.MediaCache : Object {
         switch (statement.column_int (DetailColumn.TYPE)) {
             case 0:
                 // this is a container
-                object = factory.get_container (this, object_id, title, 0, uri);
+                object = factory.get_container (object_id, title, 0, uri);
 
                 var container = object as MediaContainer;
                 if (uri != null) {
@@ -704,8 +704,7 @@ public class Rygel.MediaExport.MediaCache : Object {
                 // this is an item
                 unowned string upnp_class = statement.column_text
                                         (DetailColumn.CLASS);
-                object = factory.get_item (this,
-                                           parent,
+                object = factory.get_item (parent,
                                            object_id,
                                            title,
                                            upnp_class);
diff --git a/src/plugins/media-export/rygel-media-export-node-query-container.vala b/src/plugins/media-export/rygel-media-export-node-query-container.vala
index 8d65cd8..8cea8d0 100644
--- a/src/plugins/media-export/rygel-media-export-node-query-container.vala
+++ b/src/plugins/media-export/rygel-media-export-node-query-container.vala
@@ -53,8 +53,7 @@ internal class Rygel.MediaExport.NodeQueryContainer : QueryContainer {
 
         if (this.add_all_container ()) {
             var id = this.template.replace (",upnp:album,%s","");
-            var container = factory.create_from_description (this.media_db,
-                                                             id,
+            var container = factory.create_from_description (id,
                                                              _("All"));
             container.parent = this;
             children.add (container);
@@ -72,8 +71,7 @@ internal class Rygel.MediaExport.NodeQueryContainer : QueryContainer {
             // template contains URL escaped text. This means it might
             // contain '%' chars which will makes sprintf crash
             new_id = this.template.replace ("%s", new_id);
-            var container = factory.create_from_description (this.media_db,
-                                                             new_id,
+            var container = factory.create_from_description (new_id,
                                                              meta_data);
             container.parent = this;
             children.add (container);
diff --git a/src/plugins/media-export/rygel-media-export-object-factory.vala b/src/plugins/media-export/rygel-media-export-object-factory.vala
index d56c11c..11c82a4 100644
--- a/src/plugins/media-export/rygel-media-export-object-factory.vala
+++ b/src/plugins/media-export/rygel-media-export-object-factory.vala
@@ -28,8 +28,7 @@ internal class Rygel.MediaExport.ObjectFactory : Object {
      * @param title title of the container
      * @param child_count number of children in the container
      */
-    public virtual DBContainer get_container (MediaCache media_db,
-                                              string     id,
+    public virtual DBContainer get_container (string     id,
                                               string     title,
                                               uint       child_count,
                                               string?    uri) {
@@ -52,7 +51,7 @@ internal class Rygel.MediaExport.ObjectFactory : Object {
 
         if (id.has_prefix (QueryContainer.PREFIX)) {
             var factory = QueryContainerFactory.get_default ();
-            return factory.create_from_id (media_db, id, title);
+            return factory.create_from_id (id, title);
         }
 
         if (uri == null) {
@@ -70,8 +69,7 @@ internal class Rygel.MediaExport.ObjectFactory : Object {
      * @param title title of the item
      * @param upnp_class upnp_class of the item
      */
-    public virtual MediaItem get_item (MediaCache     media_db,
-                                       MediaContainer parent,
+    public virtual MediaItem get_item (MediaContainer parent,
                                        string         id,
                                        string         title,
                                        string         upnp_class) {
diff --git a/src/plugins/media-export/rygel-media-export-query-container-factory.vala b/src/plugins/media-export/rygel-media-export-query-container-factory.vala
index 5a3c21f..6107325 100644
--- a/src/plugins/media-export/rygel-media-export-query-container-factory.vala
+++ b/src/plugins/media-export/rygel-media-export-query-container-factory.vala
@@ -80,22 +80,20 @@ internal class Rygel.MediaExport.QueryContainerFactory : Object {
      *
      * Create a QueryContainer directly from MD5 hashed id.
      *
-     * @param cache An instance of the meta-data cache
      * @param id    The hashed id of the container
      * @param name  An the title of the container. If not supplied, it will
      *              be derived from the plain-text description of the
      *              container
      * @return A new instance of QueryContainer or null if id does not exist
      */
-    public QueryContainer? create_from_id (MediaCache cache,
-                                          string     id,
+    public QueryContainer? create_from_id (string     id,
                                           string     name = "") {
         var definition = this.get_virtual_container_definition (id);
         if (definition == null) {
             return null;
         }
 
-        return this.create_from_description (cache, definition, name);
+        return this.create_from_description (definition, name);
     }
 
     /**
@@ -103,15 +101,13 @@ internal class Rygel.MediaExport.QueryContainerFactory : Object {
      *
      * Create a QueryContainer from a plain-text description string.
      *
-     * @param cache      An instance of the meta-data cache
      * @param definition Plain-text defintion of the query-container
      * @param name       The title of the container. If not supplied, it
      *                   will be derived from the plain-text description of
      *                   the container
      * @return A new instance of QueryContainer
      */
-    public QueryContainer create_from_description (MediaCache cache,
-                                                   string     definition,
+    public QueryContainer create_from_description (string     definition,
                                                    string     name = "") {
         var title = name;
         string attribute = null;
diff --git a/src/plugins/media-export/rygel-media-export-root-container.vala b/src/plugins/media-export/rygel-media-export-root-container.vala
index c800354..b7f5b41 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -92,7 +92,7 @@ public class Rygel.MediaExport.RootContainer : TrackableDbContainer {
 
         if (object == null && id.has_prefix (QueryContainer.PREFIX)) {
             var factory = QueryContainerFactory.get_default ();
-            var container = factory.create_from_id (this.media_db, id);
+            var container = factory.create_from_id (id);
             if (container != null) {
                 container.parent = this;
             }
@@ -234,7 +234,7 @@ public class Rygel.MediaExport.RootContainer : TrackableDbContainer {
 
             var factory = QueryContainerFactory.get_default ();
 
-            return factory.create_from_description (this.media_db, id);
+            return factory.create_from_description (id);
         }
 
         return null;
@@ -302,8 +302,7 @@ public class Rygel.MediaExport.RootContainer : TrackableDbContainer {
                                           escaped_detail,
                                           last_argument);
 
-        container = factory.create_from_description (this.media_db,
-                                                     new_id);
+        container = factory.create_from_description (new_id);
 
         return true;
     }
@@ -434,8 +433,7 @@ public class Rygel.MediaExport.RootContainer : TrackableDbContainer {
 
         var factory = QueryContainerFactory.get_default ();
         var query_container = factory.create_from_description
-                                        (this.media_db,
-                                         id,
+                                        (id,
                                          _(definition.title));
 
         if (query_container.child_count > 0) {



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