diff options
author | Jędrzej Nowacki <jedrzej.nowacki@digia.com> | 2013-12-19 10:12:35 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-22 14:09:19 +0100 |
commit | 6111cc55cabc25e4a56e19682bbb481ef5886ca8 (patch) | |
tree | 942d3dc25536543d61002d84eb37cad4242009ed | |
parent | 74fc4229856d6598c66638851c4229814589e887 (diff) |
Add comment to moc output to simplify slots flags reading.
Change-Id: I5b8f63b6fa561c108abed4c2726b3aff99144fe2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | src/tools/moc/generator.cpp | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index 1af344e908..d831edfef0 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -641,25 +641,38 @@ void Generator::generateFunctions(const QList<FunctionDef>& list, const char *fu for (int i = 0; i < list.count(); ++i) { const FunctionDef &f = list.at(i); + QByteArray comment; unsigned char flags = type; - if (f.access == FunctionDef::Private) + if (f.access == FunctionDef::Private) { flags |= AccessPrivate; - else if (f.access == FunctionDef::Public) + comment.append(QByteArrayLiteral("Private")); + } else if (f.access == FunctionDef::Public) { flags |= AccessPublic; - else if (f.access == FunctionDef::Protected) + comment.append(QByteArrayLiteral("Public")); + } else if (f.access == FunctionDef::Protected) { flags |= AccessProtected; - if (f.isCompat) + comment.append(QByteArrayLiteral("Protected")); + } + if (f.isCompat) { flags |= MethodCompatibility; - if (f.wasCloned) + comment.append(QByteArrayLiteral(" | MethodCompatibility")); + } + if (f.wasCloned) { flags |= MethodCloned; - if (f.isScriptable) + comment.append(QByteArrayLiteral(" | MethodCloned")); + } + if (f.isScriptable) { flags |= MethodScriptable; - if (f.revision > 0) + comment.append(QByteArrayLiteral(" | isScriptable")); + } + if (f.revision > 0) { flags |= MethodRevisioned; + comment.append(QByteArrayLiteral(" | MethodRevisioned")); + } int argc = f.arguments.count(); - fprintf(out, " %4d, %4d, %4d, %4d, 0x%02x,\n", - stridx(f.name), argc, paramsIndex, stridx(f.tag), flags); + fprintf(out, " %4d, %4d, %4d, %4d, 0x%02x /* %s */,\n", + stridx(f.name), argc, paramsIndex, stridx(f.tag), flags, comment.constData()); paramsIndex += 1 + argc * 2; } |