[rygel] core: MediaObjectSearch provides error
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [rygel] core: MediaObjectSearch provides error
- Date: Sun, 20 Sep 2009 23:27:02 +0000 (UTC)
commit 3ba1e8486548fb89c4b16a91147cc3ec874ab036
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Thu Sep 17 17:28:05 2009 +0300
core: MediaObjectSearch provides error
MediaObjectSearch provides an error through a field to it's users rather
than printing it as a warning.
src/rygel/rygel-media-object-search.vala | 7 +++----
src/rygel/rygel-simple-container.vala | 1 +
2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/rygel/rygel-media-object-search.vala b/src/rygel/rygel-media-object-search.vala
index 57e0b70..211412d 100644
--- a/src/rygel/rygel-media-object-search.vala
+++ b/src/rygel/rygel-media-object-search.vala
@@ -28,7 +28,7 @@ using Gee;
* A utililty class to easy searching of media objects from a bunch of
* MediaContainer hierarchies. If search is successful, media_object is set
* accordingly so if it's null at the completion of the search, it means that
- * search was unsuccesful.
+ * search was unsuccesful. In case of error, the error field is set accordingly.
*/
internal class Rygel.MediaObjectSearch<G> : GLib.Object, Rygel.StateMachine {
public string id;
@@ -38,6 +38,7 @@ internal class Rygel.MediaObjectSearch<G> : GLib.Object, Rygel.StateMachine {
public Cancellable cancellable { get; set; }
public MediaObject media_object;
+ public Error error;
public MediaObjectSearch (string id,
ArrayList<MediaContainer> containers,
@@ -76,9 +77,7 @@ internal class Rygel.MediaObjectSearch<G> : GLib.Object, Rygel.StateMachine {
this.completed ();
}
} catch (Error err) {
- warning ("Error while searching for '%s': %s\n",
- this.id,
- err.message);
+ this.error = err;
this.completed ();
}
}
diff --git a/src/rygel/rygel-simple-container.vala b/src/rygel/rygel-simple-container.vala
index 68fbbfc..c91d948 100644
--- a/src/rygel/rygel-simple-container.vala
+++ b/src/rygel/rygel-simple-container.vala
@@ -126,6 +126,7 @@ public class Rygel.SimpleContainer : Rygel.MediaContainer {
MediaObjectSearch<Rygel.SimpleAsyncResult<MediaObject>>;
search.data.data = search.media_object;
+ search.data.error = search.error;
search.data.complete ();
this.searches.remove (search);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]