diff qt/qtd/MOC.d @ 322:7c2cf27391c4 signals

A slight change of the connect syntax. More sofisticated signals/slots lookup. Some fixes in examples.
author eldar_ins@eldar-laptop
date Sun, 27 Dec 2009 21:13:38 +0500
parents 5c6455c4889b
children 7a3c43424dca
line wrap: on
line diff
--- a/qt/qtd/MOC.d	Sat Dec 26 05:10:16 2009 +0500
+++ b/qt/qtd/MOC.d	Sun Dec 27 21:13:38 2009 +0500
@@ -423,7 +423,11 @@
 {
     string ret;
     foreach(i, _; Args)
-        ret ~= ", " ~ Args[i].stringof;
+    {
+        if (i > 0)
+            ret ~= ", ";
+        ret ~= Args[i].stringof;
+    }
     return ret;
 }
 string genMetaMethodsConstr(alias Funcs)(string className)
@@ -433,7 +437,7 @@
     foreach(i, bogus; Repeat!(void, funcsCount))
     {
         res ~= "        index++;\n" ~
-               "        _staticMetaObject.addMethod(new " ~ className ~ "(signature!(\"" ~ MetaEntryName!(Funcs.at[i].at) ~ "\"" ~ dDeclArgs!(MetaEntryArgs!(Funcs.at[i].at))()~ "), index));\n\n";
+               "        _staticMetaObject.addMethod(new " ~ className ~ "(signature!(" ~ dDeclArgs!(MetaEntryArgs!(Funcs.at[i].at))()~ ")(\"" ~ MetaEntryName!(Funcs.at[i].at) ~ "\"), index));\n\n";
     }
     return res;
 }
@@ -505,18 +509,7 @@
 template Q_OBJECT_BIND()
 {
 }
-/*
-template Q_OBJECT()
-{
-//    pragma(msg, toStringNow!(lastSignalIndex!(typeof(this))));
-    mixin ("enum lastSignalIndex_" ~ typeof(this).stringof ~ " = " ~ toStringNow!(lastSignalIndex!(typeof(this))) ~ ";");
-    
-    alias TupleWrapper!(findSymbols!(slotPrefix,   typeof(this), ByOwner!(typeof(this)))) Slots;
-    alias TupleWrapper!(findSymbols!(signalPrefix, typeof(this), ByOwner!(typeof(this)))) Signals;
-    pragma(msg, generateMetaInfo!((typeof(this)).stringof, Signals, Slots)());
-    mixin(generateMetaInfo!((typeof(this)).stringof, Signals, Slots)());
-}
-*/
+
 // ------------------------------------------------------------------------------------------
 
 string generateSignalEmitters(alias Funcs)()