[PATCH 5/7] core: Add a default root media in notify_change()
- From: "Juan A. Suarez Romero" <jasuarez igalia com>
- To: grilo-list gnome org
- Subject: [PATCH 5/7] core: Add a default root media in notify_change()
- Date: Tue, 1 Feb 2011 18:09:10 +0100
If plugin use a NULL-media in notify_change(), replace it by the GrlBox that
represents the root.
Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>
---
src/grl-media-source.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/src/grl-media-source.c b/src/grl-media-source.c
index c27e5aa..b7368f1 100644
--- a/src/grl-media-source.c
+++ b/src/grl-media-source.c
@@ -2585,7 +2585,7 @@ void grl_media_source_notify_change_stop (GrlMediaSource *source)
/**
* grl_media_source_notify_change:
* @source: a media source
- * @media: (allow-none): the media which has changed
+ * @media: (allow-none): the media which has changed, or @NULL to use the root box.
* @change_type: the type of change
* @location_unknown: if change has happpened in @media or any descendant
*
@@ -2605,13 +2605,25 @@ void grl_media_source_notify_change (GrlMediaSource *source,
GrlMediaSourceChangeType change_type,
gboolean location_unknown)
{
+ gboolean free_media = FALSE;
+
g_return_if_fail (GRL_IS_MEDIA_SOURCE (source));
g_return_if_fail (!media || GRL_IS_MEDIA (media));
+ if (!media) {
+ media = grl_media_box_new();
+ free_media = TRUE;
+ }
+
+ grl_media_set_source (media,
+ grl_metadata_source_get_id (GRL_METADATA_SOURCE (source)));
g_signal_emit (source,
registry_signals[SIG_CONTENT_CHANGED],
0,
media,
change_type,
location_unknown);
+ if (free_media) {
+ g_object_unref (media);
+ }
}
--
1.7.3.5
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]