summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@theqtcompany.com>2016-07-27 10:42:31 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2016-07-28 08:03:08 +0000
commit8fe54cfcf2fd1a3d2dfc44543d78450dafa01793 (patch)
treee6363cdcd8094592d4cc0f33425c66758dec9f30 /tools
parentf2106487b72a0b1b14d3bce4ebec3a7dd548b400 (diff)
Generate forward declarations for all submachines
Before, we've skipped the first machine twice. Change-Id: Ia85f01139bd948aec0b2422b9f9bedfa6261148d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tools')
-rw-r--r--tools/qscxmlc/scxmlcppdumper.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/qscxmlc/scxmlcppdumper.cpp b/tools/qscxmlc/scxmlcppdumper.cpp
index a22089e..76456cf 100644
--- a/tools/qscxmlc/scxmlcppdumper.cpp
+++ b/tools/qscxmlc/scxmlcppdumper.cpp
@@ -477,8 +477,7 @@ void CppDumper::dump(TranslationUnit *unit)
const QString headerGuard = headerName.toUpper()
.replace(QLatin1Char('.'), QLatin1Char('_'))
.replace(QLatin1Char('-'), QLatin1Char('_'));
- QStringList forwardDecls = classNames;
- forwardDecls.pop_front();
+ const QStringList forwardDecls = classNames.mid(1);
writeHeaderStart(headerGuard, forwardDecls);
writeImplStart();
@@ -515,9 +514,8 @@ void CppDumper::writeHeaderStart(const QString &headerGuard, const QStringList &
h << l("namespace ") << m_translationUnit->namespaceName << l(" {") << endl << endl;
if (!forwardDecls.isEmpty()) {
- for (int i = 1, ei = forwardDecls.size(); i != ei; ++i) {
- h << QStringLiteral("class %1;").arg(forwardDecls.at(i)) << endl;
- }
+ foreach (const QString &forwardDecl, forwardDecls)
+ h << QStringLiteral("class %1;").arg(forwardDecl) << endl;
h << endl;
}
}