From: Jürg Billeter Date: Tue, 9 Dec 2008 16:50:17 +0000 (+0000) Subject: Fix dbus-glib type for structs X-Git-Tag: VALA_0_5_3~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8386dcf64bf7a35bcb409adbd5beca231f5b4e24;p=thirdparty%2Fvala.git Fix dbus-glib type for structs 2008-12-09 Jürg Billeter * gobject/valadbusclientmodule.vala: Fix dbus-glib type for structs svn path=/trunk/; revision=2128 --- diff --git a/ChangeLog b/ChangeLog index 0682fc6bf..5ec2f5f1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-12-09 Jürg Billeter + + * gobject/valadbusclientmodule.vala: + + Fix dbus-glib type for structs + 2008-12-09 Jürg Billeter * gobject/valadbusclientmodule.vala: diff --git a/gobject/valadbusclientmodule.vala b/gobject/valadbusclientmodule.vala index 5174614c8..1f77f7251 100644 --- a/gobject/valadbusclientmodule.vala +++ b/gobject/valadbusclientmodule.vala @@ -497,10 +497,29 @@ public class Vala.DBusClientModule : DBusModule { var type_args = data_type.get_type_arguments (); cmap_type.add_argument (new CCodeConstant ("\"GHashTable\"")); - foreach (DataType type_arg in type_args) + foreach (DataType type_arg in type_args) { cmap_type.add_argument (get_dbus_g_type (type_arg)); + } return cmap_type; + } else if (data_type.data_type.get_type_signature ().has_prefix ("(")) { + // struct parameter + var st = (Struct) data_type.data_type; + + var type_call = new CCodeFunctionCall (new CCodeIdentifier ("dbus_g_type_get_struct")); + type_call.add_argument (new CCodeConstant ("\"GValueArray\"")); + + foreach (Field f in st.get_fields ()) { + if (f.binding != MemberBinding.INSTANCE) { + continue; + } + + type_call.add_argument (get_dbus_g_type (f.field_type)); + } + + type_call.add_argument (new CCodeConstant ("G_TYPE_INVALID")); + + return type_call; } else { return new CCodeIdentifier (data_type.data_type.get_type_id ()); }