[grilo-plugins] filesystem: Add ID only on new medias
- From: Juan A. Suarez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo-plugins] filesystem: Add ID only on new medias
- Date: Thu, 28 Apr 2011 14:31:39 +0000 (UTC)
commit d1dd3e0656a79014cc95d0f809bc7fb3973abe6b
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date: Thu Apr 28 14:29:08 2011 +0000
filesystem: Add ID only on new medias
If a GrlMedia already has an id, do not replace it with a new one.
This was causing also a bad memory reference, as an id was used in some place
after being replaced by a new one. This commit fixes it.
Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>
src/media/filesystem/grl-filesystem.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/media/filesystem/grl-filesystem.c b/src/media/filesystem/grl-filesystem.c
index 423099f..7c93a0e 100644
--- a/src/media/filesystem/grl-filesystem.c
+++ b/src/media/filesystem/grl-filesystem.c
@@ -410,6 +410,7 @@ create_content (GrlMedia *content,
error->message);
if (!media) {
media = grl_media_new ();
+ grl_media_set_id (media, root_dir ? NULL : path);
}
/* Title */
@@ -436,6 +437,7 @@ create_content (GrlMedia *content,
media = grl_media_new ();
}
}
+ grl_media_set_id (media, root_dir ? NULL : path);
}
if (!GRL_IS_MEDIA_BOX (media)) {
@@ -474,8 +476,6 @@ create_content (GrlMedia *content,
g_object_unref (info);
}
- grl_media_set_id (media, root_dir ? NULL : path);
-
/* URL */
str = g_file_get_uri (file);
grl_media_set_url (media, str);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]