seed r57 - trunk/libseed



Author: racarr
Date: Sun Nov  2 08:42:44 2008
New Revision: 57
URL: http://svn.gnome.org/viewvc/seed?rev=57&view=rev

Log:
Make G_TYPE_ENUM constructor properties work.


Modified:
   trunk/libseed/seed-engine.c

Modified: trunk/libseed/seed-engine.c
==============================================================================
--- trunk/libseed/seed-engine.c	(original)
+++ trunk/libseed/seed-engine.c	Sun Nov  2 08:42:44 2008
@@ -100,6 +100,7 @@
 	
 		while(i < nparams)
 		{
+				GType type;
 				jsprop_name = JSPropertyNameArrayGetNameAtIndex(jsprops, i);
 		
 				length = JSStringGetMaximumUTF8CStringSize(jsprop_name);
@@ -116,10 +117,15 @@
 												   (JSObjectRef)arguments[0],
 												   jsprop_name,
 												   NULL);
+				
+				if (g_type_is_a(param_spec->value_type, G_TYPE_ENUM))
+						type = G_TYPE_INT;
+				else
+						type = param_spec->value_type;
 		
 				if (!seed_gvalue_from_seed_value(
 							jsprop_value,
-							G_PARAM_SPEC_VALUE_TYPE(param_spec), 
+							type,
 							&params[i].value))
 				{
 						g_free(prop_name);



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