+2008-02-23 Jürg Billeter <j@bitron.ch>
+
+ * vala/valaformalparameter.vala,
+ gobject/valaccodeassignmentbinding.vala,
+ gobject/valaccodegeneratorinvocationexpression.vala: fix D-Bus
+ method calls and signal handlers, fixes bug 516194
+
2008-02-23 Raffaele Sandrini <raffaele@sandrini.ch>
* gobject/valaccodegenerator.vala, vala/valaerrortype.vala: fix
}
// third resp. sixth argument: handler
- ccall.add_argument (new CCodeCastExpression (new CCodeIdentifier (generate_signal_handler_wrapper (m, sig)), "GCallback"));
+ if (sig is DBusSignal) {
+ // signal handler wrappers not used for D-Bus signals
+ ccall.add_argument (new CCodeCastExpression (new CCodeIdentifier (m.get_cname ()), "GCallback"));
+ } else {
+ ccall.add_argument (new CCodeCastExpression (new CCodeIdentifier (generate_signal_handler_wrapper (m, sig)), "GCallback"));
+ }
if (m.instance) {
// g_signal_connect_object or g_signal_handlers_disconnect_matched
first = false;
continue;
}
- sig.add_parameter (param);
+ sig.add_parameter (param.copy ());
}
sig.accept (codegen);
cb_fun.block.add_statement (cdecl);
cend_call.add_argument (get_dbus_array_type (array_type));
cend_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (param.name)));
- creply_call.add_argument (new CCodeMemberAccess.pointer (new CCodeIdentifier (param.name), "len"));
creply_call.add_argument (new CCodeMemberAccess.pointer (new CCodeIdentifier (param.name), "data"));
+ creply_call.add_argument (new CCodeMemberAccess.pointer (new CCodeIdentifier (param.name), "len"));
} else {
var cdecl = new CCodeDeclaration (param.type_reference.get_cname ());
cdecl.add_declarator (new CCodeVariableDeclarator (param.name));
break;
}
- carg_map.set (get_param_pos (i - 0.1), new CCodeIdentifier (arg.static_type.data_type.get_type_id ()));
+ carg_map.set (get_param_pos (i - 0.1, true), new CCodeIdentifier (arg.static_type.data_type.get_type_id ()));
}
CCodeExpression cexpr = (CCodeExpression) arg.ccodenode;
var dbus_attr = dbus_iface.get_attribute ("DBusInterface");
carg_map.set (get_param_pos (-1), new CCodeConstant ("\"%s\"".printf (dbus_attr.get_string ("name"))));
} else if (m is DBusMethod) {
- carg_map.set (get_param_pos (-1), new CCodeIdentifier ("G_TYPE_INVALID"));
+ carg_map.set (get_param_pos (-1, true), new CCodeIdentifier ("G_TYPE_INVALID"));
}
if (expr.can_fail && !(m is DBusMethod)) {