[json-glib] Added an additional warning to json_gobject_new()
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [json-glib] Added an additional warning to json_gobject_new()
- Date: Wed, 13 Jul 2011 20:28:30 +0000 (UTC)
commit 996d89911d71f54f9a476242f1bd43c077d4428c
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Wed Jul 13 15:27:07 2011 -0400
Added an additional warning to json_gobject_new()
The same warning that is fired when failing to deserialize
properties normally needed to be added for the case that
we fail to deserialize construct-only properties.
json-glib/json-gobject.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/json-glib/json-gobject.c b/json-glib/json-gobject.c
index 0b91a5e..68d0d95 100644
--- a/json-glib/json-gobject.c
+++ b/json-glib/json-gobject.c
@@ -232,7 +232,12 @@ json_gobject_new (GType gtype,
val = json_object_get_member (object, member_name);
res = json_deserialize_pspec (¶m.value, pspec, val);
if (!res)
- g_value_unset (¶m.value);
+ {
+ g_warning ("Failed to deserialize \"%s\" property of type \"%s\" for an object of type \"%s\"",
+ pspec->name, G_VALUE_TYPE_NAME (¶m.value), g_type_name (gtype));
+
+ g_value_unset (¶m.value);
+ }
else
{
param.name = g_strdup (pspec->name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]