From: Zeeshan Ali (Khattak) Date: Mon, 11 May 2009 15:55:44 +0000 (+0300) Subject: Keyword substitution goes to ExternalContainer X-Git-Tag: RYGEL_0_3~75 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=21d39710abb261046ccad41318a3a7f68c772f68;p=profile%2Fivi%2Frygel.git Keyword substitution goes to ExternalContainer --- diff --git a/src/plugins/external/rygel-external-container.vala b/src/plugins/external/rygel-external-container.vala index 4ce9ccc..f08149f 100644 --- a/src/plugins/external/rygel-external-container.vala +++ b/src/plugins/external/rygel-external-container.vala @@ -121,6 +121,17 @@ public class Rygel.ExternalContainer : MediaContainer { return simple_res.data; } + public string substitute_keywords (string title) { + var new_title = title.replace ("@REALNAME@", + Environment.get_real_name ()); + new_title = new_title.replace ("@USERNAME@", + Environment.get_user_name ()); + new_title = new_title.replace ("@HOSTNAME@", + Environment.get_host_name ()); + + return new_title; + } + // Private methods private MediaObject? find_object_sync (string id) { MediaObject obj = null; diff --git a/src/plugins/external/rygel-external-item.vala b/src/plugins/external/rygel-external-item.vala index 71eed84..055270d 100644 --- a/src/plugins/external/rygel-external-item.vala +++ b/src/plugins/external/rygel-external-item.vala @@ -50,12 +50,7 @@ public class Rygel.ExternalItem : MediaItem { Value value; props.Get (OBJECT_IFACE, "display-name", out value); - this.title = value.get_string ().replace ("@REALNAME@", - Environment.get_real_name ()); - this.title = this.title.replace ("@USERNAME@", - Environment.get_user_name ()); - this.title = this.title.replace ("@HOSTNAME@", - Environment.get_host_name ()); + this.title = parent.substitute_keywords (value.get_string ()); props.Get (ITEM_IFACE, "type", out value); string type = value.get_string ();