summaryrefslogtreecommitdiffstats
path: root/src/tools/moc
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-04-16 12:04:34 +0200
committerLars Knoll <lars.knoll@nokia.com>2012-04-16 12:04:34 +0200
commit9bd032355163d92cda5e7e59ecd21214b131f187 (patch)
tree002fa12558505683143c7eb08949a3d225bf0712 /src/tools/moc
parentd037d25c3d5236623371cf051aaf6a9e59792ba7 (diff)
parent41673c45dde2eb95ee21dd918235218399f2be2c (diff)
Merge remote-tracking branch 'origin/master' into api_changes
Conflicts: configure src/corelib/io/qurl.cpp src/gui/kernel/qwindow.cpp src/tools/moc/generator.cpp src/widgets/kernel/qwidget_qpa.cpp src/widgets/styles/qstyle.h src/widgets/widgets/qtabbar.cpp tests/auto/corelib/codecs/utf8/tst_utf8.cpp Change-Id: Ia457228d6f684ec8184e13e8fcc9d25857b1751e
Diffstat (limited to 'src/tools/moc')
-rw-r--r--src/tools/moc/generator.cpp10
-rw-r--r--src/tools/moc/preprocessor.cpp2
2 files changed, 10 insertions, 2 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index cc66ca9963..74cdc5874c 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -1213,8 +1213,14 @@ void Generator::generateSignal(FunctionDef *def,int index)
fprintf(out, "%s _t%d%s", a.type.name.constData(), offset++, a.rightType.constData());
}
fprintf(out, ")%s\n{\n", constQualifier);
- if (def->type.name.size() && def->normalizedType != "void")
- fprintf(out, " %s _t0 = %s();\n", noRef(def->normalizedType).constData(), noRef(def->normalizedType).constData());
+ if (def->type.name.size() && def->normalizedType != "void") {
+ QByteArray returnType = noRef(def->normalizedType);
+ if (returnType.endsWith('*')) {
+ fprintf(out, " %s _t0 = 0;\n", returnType.constData());
+ } else {
+ fprintf(out, " %s _t0 = %s();\n", returnType.constData(), returnType.constData());
+ }
+ }
fprintf(out, " void *_a[] = { ");
if (def->normalizedType == "void") {
diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp
index 696b32c728..d88c9f2950 100644
--- a/src/tools/moc/preprocessor.cpp
+++ b/src/tools/moc/preprocessor.cpp
@@ -915,6 +915,8 @@ void Preprocessor::preprocess(const QByteArray &filename, Symbols &preprocessed)
case PP_ENDIF:
until(PP_NEWLINE);
continue;
+ case PP_NEWLINE:
+ continue;
case SIGNALS:
case SLOTS: {
Symbol sym = symbol();