[grilo] core: Serialize/unserialize gboolean metadata keys
- From: Juan A. Suarez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo] core: Serialize/unserialize gboolean metadata keys
- Date: Thu, 1 Nov 2012 22:44:10 +0000 (UTC)
commit 64da840144713035efe0525bbc7bcbdafc08ed1e
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date: Thu Nov 1 10:29:48 2012 +0000
core: Serialize/unserialize gboolean metadata keys
src/data/grl-media.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/data/grl-media.c b/src/data/grl-media.c
index 07a8d1d..5ab937b 100644
--- a/src/data/grl-media.c
+++ b/src/data/grl-media.c
@@ -378,6 +378,8 @@ grl_media_serialize_extended (GrlMedia *media,
g_string_append_printf (serial, "%d", g_value_get_int (value));
} else if (G_VALUE_HOLDS_FLOAT (value)) {
g_string_append_printf (serial, "%f", g_value_get_float (value));
+ } else if (G_VALUE_HOLDS_BOOLEAN (value)) {
+ g_string_append_printf (serial, "%d", g_value_get_boolean (value));
}
g_string_append_c (serial, '&');
}
@@ -502,6 +504,9 @@ grl_media_unserialize (const gchar *serial)
case G_TYPE_FLOAT:
grl_data_set_float (GRL_DATA (media), grlkey, atof (value));
break;
+ case G_TYPE_BOOLEAN:
+ grl_data_set_boolean (GRL_DATA (media), grlkey, atoi (value) == 0? FALSE: TRUE);
+ break;
}
g_free (escaped_value);
g_free (value);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]