From 187cae3b971f7b6180d20aa40f88ea487c7dfc41 Mon Sep 17 00:00:00 2001 From: "Zeeshan Ali (Khattak)" Date: Wed, 18 Aug 2010 15:06:40 +0300 Subject: [PATCH] tracker: Create ID from title rather then the value Create ID of MetadataValues' children from their title rather then the associated 'value' of the child. This also implies that Years container now only provide the method for title creation rather than ID creation. With this change, the 'Year' hierarchy works again. \o/ --- src/plugins/tracker/rygel-tracker-metadata-values.vala | 9 ++++----- src/plugins/tracker/rygel-tracker-years.vala | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/plugins/tracker/rygel-tracker-metadata-values.vala b/src/plugins/tracker/rygel-tracker-metadata-values.vala index 49309ee..aa2dc74 100644 --- a/src/plugins/tracker/rygel-tracker-metadata-values.vala +++ b/src/plugins/tracker/rygel-tracker-metadata-values.vala @@ -125,13 +125,12 @@ public abstract class Rygel.Tracker.MetadataValues : Rygel.SimpleContainer { continue; } - var id = this.create_id_for_value (value); + var title = this.create_title_for_value (value); + var id = this.create_id_for_title (title); if (!this.is_child_id_unique (id)) { continue; } - var title = this.create_title_for_value (value); - // The child container can use the same triplets we used in our // query. var child_triplets = new QueryTriplets.clone (triplets); @@ -164,8 +163,8 @@ public abstract class Rygel.Tracker.MetadataValues : Rygel.SimpleContainer { } } - protected virtual string create_id_for_value (string value) { - return this.id + ":" + value; + protected virtual string create_id_for_title (string title) { + return this.id + ":" + title; } protected virtual string create_title_for_value (string value) { diff --git a/src/plugins/tracker/rygel-tracker-years.vala b/src/plugins/tracker/rygel-tracker-years.vala index 666a681..d9ef9f5 100644 --- a/src/plugins/tracker/rygel-tracker-years.vala +++ b/src/plugins/tracker/rygel-tracker-years.vala @@ -37,12 +37,12 @@ public class Rygel.Tracker.Years : MetadataValues { KEY_CHAIN); } - protected override string create_id_for_value (string value) { + protected override string create_title_for_value (string value) { return value.ndup (4); } protected override string create_filter (string variable, string value) { - var year = this.create_id_for_value (value); + var year = this.create_title_for_value (value); var next_year = (year.to_int () + 1).to_string (); year += "-01-01T00:00:00Z"; -- 2.7.4