[seed] struct - constructor set_property - show warning on failure



commit 7e337de26b10a7670b7d438e9037884d4a216fac
Author: Alan Knowles <alan akbkhome com>
Date:   Tue May 4 12:56:42 2010 +0800

    struct - constructor set_property - show warning on failure
    
    rather than silently ignore failure, show a g_warning message

 libseed/seed-structs.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/libseed/seed-structs.c b/libseed/seed-structs.c
index e3dd2d7..088151b 100644
--- a/libseed/seed-structs.c
+++ b/libseed/seed-structs.c
@@ -698,6 +698,7 @@ seed_construct_struct_type_with_parameters (JSContextRef ctx,
   gpointer object;
   GIInfoType type = g_base_info_get_type (info);
   JSObjectRef ret;
+  gboolean set_ret;
   gint nparams, i = 0;
   gsize length;
   GIFieldInfo *field = 0;
@@ -786,8 +787,13 @@ seed_construct_struct_type_with_parameters (JSContextRef ctx,
 
       seed_gi_make_argument (ctx, jsprop_value, field_type, &field_value,
 			     exception);
-      g_field_info_set_field (field, object, &field_value);
+      set_ret = g_field_info_set_field (field, object, &field_value);
 
+	  if (!set_ret) 
+		g_warning("Constructor setting property failed on struct of type: %s "
+			"with name %s \n",
+			g_base_info_get_name (info), prop_name);
+  
       g_base_info_unref ((GIBaseInfo *) field_type);
       g_base_info_unref ((GIBaseInfo *) field);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]