rygel r535 - trunk/src/rygel
- From: zeeshanak svn gnome org
- To: svn-commits-list gnome org
- Subject: rygel r535 - trunk/src/rygel
- Date: Mon, 9 Feb 2009 22:27:21 +0000 (UTC)
Author: zeeshanak
Date: Mon Feb 9 22:27:21 2009
New Revision: 535
URL: http://svn.gnome.org/viewvc/rygel?rev=535&view=rev
Log:
Get rid of HTTPServer.item_requested signal.
Instead of emitting a signal, ask ContentDir to find the item for us.
Modified:
trunk/src/rygel/rygel-content-directory.vala
trunk/src/rygel/rygel-http-server.vala
Modified: trunk/src/rygel/rygel-content-directory.vala
==============================================================================
--- trunk/src/rygel/rygel-content-directory.vala (original)
+++ trunk/src/rygel/rygel-content-directory.vala Mon Feb 9 22:27:21 2009
@@ -65,8 +65,6 @@
this.browses = new ArrayList<Browse> ();
- this.http_server.item_requested += this.on_item_requested;
-
this.feature_list =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<Features xmlns=\"urn:schemas-upnp-org:av:avs\" " +
@@ -204,20 +202,5 @@
private void on_browse_completed (Browse browse) {
this.browses.remove (browse);
}
-
- private void on_item_requested (HTTPServer http_server,
- string item_id,
- out MediaItem item) {
- try {
- var media_object = this.find_object_by_id (item_id);
- if (media_object is MediaItem) {
- item = (MediaItem) media_object;
- }
- } catch (Error err) {
- warning ("Requested item '%s' not found: %s\n",
- item_id,
- err.message);
- }
- }
}
Modified: trunk/src/rygel/rygel-http-server.vala
==============================================================================
--- trunk/src/rygel/rygel-http-server.vala (original)
+++ trunk/src/rygel/rygel-http-server.vala Mon Feb 9 22:27:21 2009
@@ -45,8 +45,6 @@
public signal void need_stream_source (MediaItem item,
out Element src);
- public signal void item_requested (string item_id,
- out MediaItem item);
public HTTPServer (ContentDirectory content_dir,
string name) {
@@ -136,8 +134,8 @@
string item_id) {
MediaItem item;
- // Signal the requestion for an item
- this.item_requested (item_id, out item);
+ // Fetch the requested item
+ item = this.get_requested_item (item_id);
if (item == null) {
msg.set_status (Soup.KnownStatusCode.NOT_FOUND);
return;
@@ -335,6 +333,22 @@
}
return seek;
+ }
+
+ private MediaItem? get_requested_item (string item_id) {
+ MediaObject media_object;
+
+ try {
+ media_object = this.content_dir.find_object_by_id (item_id);
+ } catch (Error err) {
+ return null;
}
+
+ if (media_object != null && media_object is MediaItem) {
+ return (MediaItem) media_object;
+ } else {
+ return null;
+ }
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]