Commit 7c7a066e authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

don't mangle D-Bus signal names, fixes bug 528774

2008-04-19  Juerg Billeter  <j@bitron.ch>

	* vala/valasemanticanalyzer.vala, vala/valasignal.vala,
	  gobject/valaccodeassignmentbinding.vala: don't mangle D-Bus
	  signal names, fixes bug 528774

svn path=/trunk/; revision=1268
parent 78674ebd
2008-04-19 Jürg Billeter <j@bitron.ch>
* vala/valasemanticanalyzer.vala, vala/valasignal.vala,
gobject/valaccodeassignmentbinding.vala: don't mangle D-Bus
signal names, fixes bug 528774
2008-04-19 Jürg Billeter <j@bitron.ch>
* vala/valasemanticanalyzer.vala, gobject/valaccodegenerator.vala:
......
......@@ -136,9 +136,13 @@ public class Vala.CCodeAssignmentBinding : CCodeExpressionBinding {
ccall.add_argument (new CCodeIdentifier ("self"));
}
if (!disconnect || sig is DBusSignal) {
if (sig is DBusSignal) {
// dbus_g_proxy_connect_signal or dbus_g_proxy_disconnect_signal
// second argument: signal name
ccall.add_argument (new CCodeConstant ("\"%s\"".printf (sig.name)));
} else if (!disconnect) {
// g_signal_connect_object or g_signal_connect
// or dbus_g_proxy_connect_signal or dbus_g_proxy_disconnect_signal
// second argument: signal name
ccall.add_argument (sig.get_canonical_cconstant ());
......@@ -246,7 +250,7 @@ public class Vala.CCodeAssignmentBinding : CCodeExpressionBinding {
} else {
add_call.add_argument (new CCodeIdentifier ("self"));
}
add_call.add_argument (sig.get_canonical_cconstant ());
add_call.add_argument (new CCodeConstant ("\"%s\"".printf (sig.name)));
first = true;
foreach (FormalParameter param in m.get_parameters ()) {
......
......@@ -2934,8 +2934,10 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
if (ma.symbol_reference is Signal) {
var sig = (Signal) ma.symbol_reference;
a.right.expected_type = new DelegateType (sig.get_delegate ());
var deleg = sig.get_delegate ();
if (deleg != null) {
a.right.expected_type = new DelegateType (deleg);
}
} else {
a.right.expected_type = ma.static_type;
}
......
......@@ -90,8 +90,9 @@ public class Vala.Signal : Member, Lockable {
*
* @return delegate
*/
public Delegate get_delegate () {
if (generated_delegate == null) {
public Delegate? get_delegate () {
// parent_symbol is null for D-Bus signals
if (generated_delegate == null && parent_symbol != null) {
generated_delegate = new Delegate (null, return_type);
generated_delegate.instance = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment