Permalink
Browse files

cleanup whitespace and add a little more

  • Loading branch information...
icefox committed May 14, 2010
1 parent 03c2331 commit 993fac85741ee72f4fbc304789565333197c4f73
Showing with 23 additions and 5 deletions.
  1. +23 −5 src/main.cpp
View
@@ -198,13 +198,12 @@ void outputFile(ClassModelItem clazz, FunctionList functions,
out << "class Sub" + className + " : public " << className << endl;
out << "{" << endl;
{
- out << "public:";
+ out << "public:" << endl;
foreach (FunctionModelItem fun, functions) {
// implement protected or virtual functions
if (fun->accessPolicy() != CodeModel::Protected && !fun->isAbstract())
continue;
- out << endl;
if (fun->isAbstract())
out << indent << QString("// %1::%2 is a pure virtual function.").arg(className).arg(fun->name()) << endl;
out << indent << makeFunction(fun, fun->isAbstract() ? "" : "call_") << endl;
@@ -224,6 +223,7 @@ void outputFile(ClassModelItem clazz, FunctionList functions,
}
}
out << " }" << endl;
+ out << endl;
}
}
out << "};" << endl;
@@ -259,9 +259,27 @@ void outputFile(ClassModelItem clazz, FunctionList functions,
out << shortName << ".";
if (fun->accessPolicy() == CodeModel::Protected)
out << "call_";
- out << fun->name() << "(" << args.join(", ") << ")";
- if (returnType != "void")
- out << ", " << returnType << ")";
+ out << fun->name() << "(";
+ QString functionArgs = args.join(", ");
+ if (functionArgs.endsWith("*"))
+ out << "(" << functionArgs << ")0";
+ else if (functionArgs == "int")
+ out << "0";
+ else if (functionArgs == "QString const&")
+ out << "QString()";
+ else
+ out << functionArgs;
+ out << ")";
+ if (returnType != "void") {
+ out << ", ";
+ if (returnType == "int")
+ out << "0";
+ else if (returnType == "int")
+ out << "0";
+ else
+ out << returnType;
+ out << ")";
+ }
out << ";" << endl;
}
out << "#endif" << endl;

0 comments on commit 993fac8

Please sign in to comment.