[grilo-plugins] all: Use the new "content-changed" API
- From: Juan A. Suarez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo-plugins] all: Use the new "content-changed" API
- Date: Wed, 13 Apr 2011 10:19:44 +0000 (UTC)
commit 375b73b8ec970041571aa7eeb8076fb7e4667d11
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date: Thu Apr 7 14:47:17 2011 +0000
all: Use the new "content-changed" API
The new API to notify changes in source content requires to specify a list with
the changed medias, instead of just the changed media.
Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>
src/media/tracker/grl-tracker-media-notif.c | 8 +++++---
src/media/upnp/grl-upnp.c | 13 ++++++++-----
2 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/src/media/tracker/grl-tracker-media-notif.c b/src/media/tracker/grl-tracker-media-notif.c
index 5cda05f..593a00f 100644
--- a/src/media/tracker/grl-tracker-media-notif.c
+++ b/src/media/tracker/grl-tracker-media-notif.c
@@ -235,8 +235,8 @@ tracker_evt_update_orphan_item_cb (GObject *object,
GRL_DEBUG ("\tNotify id=%u source=%s p=%p", id,
grl_metadata_source_get_name (GRL_METADATA_SOURCE (source)),
source);
- grl_media_source_notify_change (GRL_MEDIA_SOURCE (source), media,
- change_type, FALSE);
+ grl_media_source_notify_change (GRL_MEDIA_SOURCE (source),
+ media, change_type, FALSE);
g_object_unref (media);
}
@@ -322,7 +322,9 @@ tracker_evt_update_orphans (tracker_evt_update_t *evt)
g_free (str_id);
grl_media_source_notify_change (GRL_MEDIA_SOURCE (source->data),
- media, GRL_CONTENT_REMOVED, FALSE);
+ media,
+ GRL_CONTENT_REMOVED,
+ FALSE);
g_object_unref (media);
}
}
diff --git a/src/media/upnp/grl-upnp.c b/src/media/upnp/grl-upnp.c
index d91ec4c..26da2de 100644
--- a/src/media/upnp/grl-upnp.c
+++ b/src/media/upnp/grl-upnp.c
@@ -280,6 +280,7 @@ container_changed_cb (GUPnPServiceProxy *proxy,
GValue *value,
gpointer user_data)
{
+ GPtrArray *changed_medias;
GrlMedia *container;
GrlMediaSource *source = GRL_MEDIA_SOURCE (user_data);
gchar **tokens;
@@ -289,16 +290,18 @@ container_changed_cb (GUPnPServiceProxy *proxy,
/* Value is a list of pairs (id, number), where "id" is the container id */
tokens = g_strsplit (g_value_get_string (value), ",", -1);
+ changed_medias = g_ptr_array_sized_new (g_strv_length (tokens) / 2);
while (tokens[i]) {
container = grl_media_box_new ();
grl_media_set_id (container, tokens[i]);
- grl_media_source_notify_change (source,
- container,
- GRL_CONTENT_CHANGED,
- FALSE);
- g_object_unref (container);
+ g_ptr_array_add (changed_medias, container);
i += 2;
}
+
+ grl_media_source_notify_change_list (source,
+ changed_medias,
+ GRL_CONTENT_CHANGED,
+ FALSE);
g_strfreev (tokens);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]