tracker: CategoryContainer creates "All" container
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Fri, 19 Feb 2010 13:34:03 +0000 (15:34 +0200)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Fri, 19 Feb 2010 13:34:03 +0000 (15:34 +0200)
Since "All" child is created/added by all category containers, why not
create/add it in the base CategoryContainer class?

src/plugins/tracker/rygel-tracker-category-container.vala
src/plugins/tracker/rygel-tracker-music.vala
src/plugins/tracker/rygel-tracker-pictures.vala
src/plugins/tracker/rygel-tracker-videos.vala

index d68e0f4..3f89ad8 100644 (file)
@@ -37,6 +37,11 @@ public class Rygel.TrackerCategoryContainer : Rygel.SimpleContainer {
 
         this.item_factory = item_factory;
 
+        this.add_child (new TrackerSearchContainer (this.id + "All",
+                                                    this,
+                                                    "All",
+                                                    this.item_factory));
+
         try {
             var uri = Filename.to_uri (item_factory.upload_dir, null);
             this.uris.add (uri);
index f935d29..373234d 100644 (file)
@@ -32,11 +32,6 @@ public class Rygel.TrackerMusic : Rygel.TrackerCategoryContainer {
                          string         title) {
         base (id, parent, title, new TrackerMusicItemFactory ());
 
-        this.add_child (new TrackerSearchContainer ("26",
-                                                    this,
-                                                    "All",
-                                                    this.item_factory));
-
         var key_chain = new string[] { "nmm:performer",
                                        "nmm:artistName",
                                        null };
index c575c97..fa48122 100644 (file)
@@ -34,10 +34,6 @@ public class Rygel.TrackerPictures : Rygel.TrackerCategoryContainer {
                             string         title) {
         base (id, parent, title, new TrackerPictureItemFactory ());
 
-        this.add_child (new TrackerSearchContainer ("25",
-                                                    this,
-                                                    "All",
-                                                    this.item_factory));
         this.add_child (new TrackerTags ("19", this, this.item_factory));
         this.add_child (new TrackerYears ("22", this, this.item_factory));
     }
index 9721cac..01507b2 100644 (file)
@@ -32,10 +32,6 @@ public class Rygel.TrackerVideos : Rygel.TrackerCategoryContainer {
                           string         title) {
         base (id, parent, title, new TrackerVideoItemFactory ());
 
-        this.add_child (new TrackerSearchContainer ("24",
-                                                    this,
-                                                    "All",
-                                                    this.item_factory));
         this.add_child (new TrackerTags ("20", this, this.item_factory));
         this.add_child (new TrackerYears ("23", this, this.item_factory));
     }