changeset 380:beb04f46ef4a

fix NULL default values
author Eldar Insafutdinov
date Sat, 10 Jul 2010 22:32:16 +0100
parents a795eeb3b21f
children 347e4c7a9ba1
files examples/qwt/simpleplot/simple.d generator/abstractmetabuilder.cpp
diffstat 2 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/examples/qwt/simpleplot/simple.d	Sat Jul 10 22:16:33 2010 +0100
+++ b/examples/qwt/simpleplot/simple.d	Sat Jul 10 22:32:16 2010 +0100
@@ -73,9 +73,8 @@
 public:
     this()
     {
-        super(cast(QWidget)null);
         setTitle("A Simple QwtPlot Demonstration");
-        insertLegend(new QwtLegend(cast(QWidget)null), QwtPlot.RightLegend);
+        insertLegend(new QwtLegend(), QwtPlot.RightLegend);
 
         // Set axis titles
         setAxisTitle(xBottom, "x -->");
--- a/generator/abstractmetabuilder.cpp	Sat Jul 10 22:16:33 2010 +0100
+++ b/generator/abstractmetabuilder.cpp	Sat Jul 10 22:32:16 2010 +0100
@@ -2024,7 +2024,7 @@
         if (expr == "QVariant()" /* qtd || expr == "QModelIndex()"*/) {
             return "null";
         } else if (expr == "QString()") {
-            return "null";
+            return "\"\"";
         } else if (expr.endsWith(")") && expr.contains("::")) {
             TypeEntry *typeEntry = TypeDatabase::instance()->findType(expr.left(expr.indexOf("::")));
             if (typeEntry)
@@ -2040,7 +2040,7 @@
                     return "new " + typeEntry->qualifiedCppName() + expr.right(expr.length() - pos);
             } else
                 return expr;
-        } else if (expr == "0") {
+        } else if (expr == "0" || expr == "NULL") {
             return "null";
         } else if (type->isObject() || type->isValue() || expr.contains("::")) { // like Qt::black passed to a QColor
             TypeEntry *typeEntry = TypeDatabase::instance()->findType(expr.left(expr.indexOf("::")));