vala r1268 - in trunk: . gobject vala



Author: juergbi
Date: Sat Apr 19 14:46:00 2008
New Revision: 1268
URL: http://svn.gnome.org/viewvc/vala?rev=1268&view=rev

Log:
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


Modified:
   trunk/ChangeLog
   trunk/gobject/valaccodeassignmentbinding.vala
   trunk/vala/valasemanticanalyzer.vala
   trunk/vala/valasignal.vala

Modified: trunk/gobject/valaccodeassignmentbinding.vala
==============================================================================
--- trunk/gobject/valaccodeassignmentbinding.vala	(original)
+++ trunk/gobject/valaccodeassignmentbinding.vala	Sat Apr 19 14:46:00 2008
@@ -136,9 +136,13 @@
 			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 @@
 			} 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 ()) {

Modified: trunk/vala/valasemanticanalyzer.vala
==============================================================================
--- trunk/vala/valasemanticanalyzer.vala	(original)
+++ trunk/vala/valasemanticanalyzer.vala	Sat Apr 19 14:46:00 2008
@@ -2934,8 +2934,10 @@
 
 			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;
 			}

Modified: trunk/vala/valasignal.vala
==============================================================================
--- trunk/vala/valasignal.vala	(original)
+++ trunk/vala/valasignal.vala	Sat Apr 19 14:46:00 2008
@@ -90,8 +90,9 @@
 	 *
 	 * @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;
 			



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