rygel r123 - in trunk: . src
- From: zeeshanak svn gnome org
- To: svn-commits-list gnome org
- Subject: rygel r123 - in trunk: . src
- Date: Tue, 28 Oct 2008 21:00:53 +0000 (UTC)
Author: zeeshanak
Date: Tue Oct 28 21:00:53 2008
New Revision: 123
URL: http://svn.gnome.org/viewvc/rygel?rev=123&view=rev
Log:
Get the root ID prefix from IDs rather than removing it.
Modified:
trunk/ChangeLog
trunk/src/gupnp-media-manager.vala
Modified: trunk/src/gupnp-media-manager.vala
==============================================================================
--- trunk/src/gupnp-media-manager.vala (original)
+++ trunk/src/gupnp-media-manager.vala Tue Oct 28 21:00:53 2008
@@ -69,14 +69,14 @@
out uint update_id) {
string didl;
- string id = this.remove_root_id_prefix (container_id);
+ string root_id = this.get_root_id_from_id (container_id);
- if (id == this.root_id) {
+ if (root_id == this.root_id) {
didl = this.browse_root_container (out number_returned,
out total_matches,
out update_id);
} else {
- weak MediaProvider provider = this.providers.lookup (id);
+ weak MediaProvider provider = this.providers.lookup (root_id);
if (provider != null) {
didl = provider.browse (container_id,
filter,
@@ -104,12 +104,12 @@
out uint update_id) {
string didl;
- string id = this.remove_root_id_prefix (object_id);
+ string root_id = this.get_root_id_from_id (object_id);
- if (id == this.root_id) {
+ if (root_id == this.root_id) {
didl = this.get_root_container_metadata (out update_id);
} else {
- weak MediaProvider provider = this.providers.lookup (id);
+ weak MediaProvider provider = this.providers.lookup (root_id);
if (provider != null) {
didl = provider.get_metadata (object_id,
filter,
@@ -203,15 +203,12 @@
this.didl_writer.end_container ();
}
- string remove_root_id_prefix (string id) {
+ string get_root_id_from_id (string id) {
string[] tokens;
tokens = id.split (":", 2);
- if (tokens[1] != null)
- return tokens[1];
- else
- return tokens[0];
+ return tokens[0];
}
private static uint id_hash_func (string id) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]