[rygel] Automatic substitution of user info in title
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Subject: [rygel] Automatic substitution of user info in title
- Date: Mon, 11 May 2009 10:05:53 -0400 (EDT)
commit 391e125e28304b3d6bcc0a62da68b3cad5d82955
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Fri May 8 17:56:55 2009 +0300
Automatic substitution of user info in title
Rygel now automatically replaces "%u" and "%n" in the plugins title with
username and real name, respectively.
---
src/plugins/folder/rygel-folder-plugin.vala | 3 +--
src/plugins/tracker/rygel-tracker-plugin.vala | 3 +--
src/rygel/rygel-media-server-factory.vala | 6 +++++-
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/plugins/folder/rygel-folder-plugin.vala b/src/plugins/folder/rygel-folder-plugin.vala
index 932d66a..d11a75d 100644
--- a/src/plugins/folder/rygel-folder-plugin.vala
+++ b/src/plugins/folder/rygel-folder-plugin.vala
@@ -36,8 +36,7 @@ using GLib;
*/
[ModuleInit]
public void load_plugin (PluginLoader loader) {
- var title = Environment.get_real_name () + "'s media";
- Plugin plugin = new Plugin ("Folder", title);
+ Plugin plugin = new Plugin ("Folder", "%n's media");
var resource_info = new ResourceInfo (ContentDirectory.UPNP_ID,
ContentDirectory.UPNP_TYPE,
diff --git a/src/plugins/tracker/rygel-tracker-plugin.vala b/src/plugins/tracker/rygel-tracker-plugin.vala
index 837a6c1..c818a2e 100644
--- a/src/plugins/tracker/rygel-tracker-plugin.vala
+++ b/src/plugins/tracker/rygel-tracker-plugin.vala
@@ -26,8 +26,7 @@ using CStuff;
[ModuleInit]
public void load_plugin (PluginLoader loader) {
- var title = Environment.get_real_name () + "'s media";
- Plugin plugin = new Plugin ("Tracker", title);
+ Plugin plugin = new Plugin ("Tracker", "%n's media");
// We only implement a ContentDirectory service
var resource_info = new ResourceInfo (ContentDirectory.UPNP_ID,
diff --git a/src/rygel/rygel-media-server-factory.vala b/src/rygel/rygel-media-server-factory.vala
index 058b2bf..d4117a8 100644
--- a/src/rygel/rygel-media-server-factory.vala
+++ b/src/rygel/rygel-media-server-factory.vala
@@ -144,7 +144,11 @@ public class Rygel.MediaServerFactory {
return;
}
- element->set_content (this.config.get_title (plugin_name));
+ var title = this.config.get_title (plugin_name);
+ title = title.replace ("%n", Environment.get_real_name ());
+ title = title.replace ("%u", Environment.get_user_name ());
+
+ element->set_content (title);
/* UDN */
element = Utils.get_xml_element (device_element, "UDN");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]