tracker: Cache ContainerUpdateID
authorJens Georg <mail@jensge.org>
Thu, 10 Nov 2011 10:31:29 +0000 (11:31 +0100)
committerJens Georg <mail@jensge.org>
Thu, 10 Nov 2011 10:31:29 +0000 (11:31 +0100)
Fixes DLNA Testcase 7.3.56.1

src/plugins/tracker/rygel-tracker-search-container.vala

index 40f5f36..59c9968 100644 (file)
@@ -41,6 +41,8 @@ public class Rygel.Tracker.SearchContainer : SimpleContainer {
 
     private ResourcesIface resources;
 
+    private static HashMap<string, uint> update_id_hash;
+
     public SearchContainer (string             id,
                             MediaContainer     parent,
                             string             title,
@@ -49,6 +51,20 @@ public class Rygel.Tracker.SearchContainer : SimpleContainer {
                             ArrayList<string>? filters = null) {
         base (id, parent, title);
 
+        if (unlikely (update_id_hash == null)) {
+            update_id_hash = new HashMap<string, uint> ();
+        }
+
+        if (update_id_hash.has_key (this.id)) {
+            this.update_id = update_id_hash[this.id];
+        }
+
+        this.container_updated.connect ( (_, b) => {
+            if (b == this) {
+                update_id_hash[this.id] = this.update_id;
+            }
+        });
+
         this.item_factory = item_factory;
 
         var variables = new ArrayList<string> ();