[rygel] tracker: Get rid of two redundant methods



commit f285cfe45e76c3b4c9a62edac4e25f9a913d3a39
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Nov 30 20:09:35 2009 +0200

    tracker: Get rid of two redundant methods
    
    - SearchContainer.create_item()
    - ItemFactory.get_num_metadata_keys()

 .../tracker/rygel-tracker-item-factory.vala        |    4 ----
 .../tracker/rygel-tracker-search-container.vala    |   14 ++------------
 2 files changed, 2 insertions(+), 16 deletions(-)
---
diff --git a/src/plugins/tracker/rygel-tracker-item-factory.vala b/src/plugins/tracker/rygel-tracker-item-factory.vala
index c91a66c..a199141 100644
--- a/src/plugins/tracker/rygel-tracker-item-factory.vala
+++ b/src/plugins/tracker/rygel-tracker-item-factory.vala
@@ -108,10 +108,6 @@ public abstract class Rygel.TrackerItemFactory {
         return keys;
     }
 
-    public int get_num_metadata_keys () {
-        return Metadata.LAST_KEY;
-    }
-
     protected string seconds_to_iso8601 (string seconds) {
         string date;
 
diff --git a/src/plugins/tracker/rygel-tracker-search-container.vala b/src/plugins/tracker/rygel-tracker-search-container.vala
index 0bf949f..41bb3c0 100644
--- a/src/plugins/tracker/rygel-tracker-search-container.vala
+++ b/src/plugins/tracker/rygel-tracker-search-container.vala
@@ -168,8 +168,9 @@ public class Rygel.TrackerSearchContainer : Rygel.MediaContainer {
         for (uint i = 0; i < search_result.length[0]; i++) {
             string uri = search_result[i, 0];
             string[] metadata = this.slice_strvv_tail (search_result, i, 1);
+            var id = this.id + ":" + uri;
 
-            var item = this.create_item (uri, metadata);
+            var item = this.item_factory.create (id, uri, this, metadata);
             results.add (item);
         }
 
@@ -235,17 +236,6 @@ public class Rygel.TrackerSearchContainer : Rygel.MediaContainer {
         return filter;
     }
 
-    private MediaItem? create_item (string   uri,
-                                    string[] metadata)
-                                    throws GLib.Error {
-        var id = this.id + ":" + uri;
-
-        return this.item_factory.create (id,
-                                         uri,
-                                         this,
-                                         metadata);
-    }
-
     // Returns the URI and the ID of the parent this item belongs to, or null
     // if item_id is invalid
     private string? get_item_info (string     item_id,



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