[Kde-bindings] playground/bindings/kimono

Richard Dale Richard_Dale at tipitina.demon.co.uk
Mon Oct 23 09:03:42 UTC 2006


SVN commit 598332 by rdale:

* If no Emit() method is found for a class, assume it doesn't have
  any signals and don't include any in the QMetaObject for it.
* Only look for methods marked Q_SLOT in the current class, and not
  the superclasses when constructing a QMetaObject.

CCMAIL: kde-bindings at kde.org



 M  +4 -0      ChangeLog  
 M  +12 -6     Qyoto.cs  


--- trunk/playground/bindings/kimono/ChangeLog #598331:598332
@@ -3,6 +3,10 @@
 	* When a QMetaObject was constructed, the parent was wrongly being
 	  set to the superclass of the superclass, rather than just the
 	  superclass
+	* If no Emit() method is found for a class, assume it doesn't have
+	  any signals and don't include any in the QMetaObject for it.
+	* Only look for methods marked Q_SLOT in the current class, and not
+	  the superclasses when constructing a QMetaObject.
 
 2006-10-22  Arno Rehn  <arno at arnorehn.de>
 
--- trunk/playground/bindings/kimono/Qyoto.cs #598331:598332
@@ -162,7 +162,11 @@
 			/// This Hashtable contains the slots of a class. The C++ type signature is the key, the appropriate array with the MethodInfo, signature and return type the value.
 			Hashtable slots = new Hashtable();
 			
-			MethodInfo[] mis = t.GetMethods( BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
+			MethodInfo[] mis = t.GetMethods(	BindingFlags.Instance 
+												| BindingFlags.Static 
+												| BindingFlags.Public 
+												| BindingFlags.NonPublic
+												| BindingFlags.DeclaredOnly );
 			
 			foreach (MethodInfo mi in mis) {
 				object[] attributes = mi.GetCustomAttributes(typeof(Q_SLOT), false);
@@ -197,13 +201,15 @@
 				return signals;
 			}
 			
-			Type iface;
-			try {
-				iface = GetSignalsInterface(t);
-			}
-			catch {
+			MethodInfo methodInfo = t.GetMethod(	"Emit", 
+													BindingFlags.Instance 
+													| BindingFlags.NonPublic 
+													| BindingFlags.DeclaredOnly );
+			if (methodInfo == null) {
 				return signals;
 			}
+
+			Type iface = methodInfo.ReturnType;
 			MethodInfo[] mis = iface.GetMethods();
 			
 			/// the interface has no signals...



More information about the Kde-bindings mailing list