aboutsummaryrefslogtreecommitdiff
path: root/automoc
diff options
context:
space:
mode:
authorMatthias Kretz <kretz@kde.org>2007-07-23 16:36:09 +0000
committerMatthias Kretz <kretz@kde.org>2007-07-23 16:36:09 +0000
commit85e90a42d8cd5baad00a11e07e2a9046953d4c8a (patch)
tree51bb132f90b87fcbde5873022a15768427a0c4ea /automoc
parentd7a84fc9dad43df4723093aa26290e503f515c5e (diff)
downloadextra-cmake-modules-85e90a42d8cd5baad00a11e07e2a9046953d4c8a.tar.gz
extra-cmake-modules-85e90a42d8cd5baad00a11e07e2a9046953d4c8a.tar.bz2
moved the waiting for moc processes to finish code back where it should be (after all moc invocations)
svn path=/trunk/KDE/kdelibs/; revision=691429
Diffstat (limited to 'automoc')
-rw-r--r--automoc/kde4automoc.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/automoc/kde4automoc.cpp b/automoc/kde4automoc.cpp
index f79c0ca8..5d0a9a03 100644
--- a/automoc/kde4automoc.cpp
+++ b/automoc/kde4automoc.cpp
@@ -220,18 +220,8 @@ bool AutoMoc::run()
generateMoc(it.key(), it.value());
}
- // let all remaining moc processes finish
- waitForProcesses();
-
- if (failed) {
- // if any moc process failed we don't want to touch the _automoc.cpp file so that
- // kde4automoc is rerun until the issue is fixed
- return false;
- }
-
- // source file that includes all remaining moc files
- outfile.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate);
- QTextStream outStream(&outfile);
+ QByteArray automocSource;
+ QTextStream outStream(&automocSource, QIODevice::WriteOnly);
outStream << "/* This file is autogenerated, do not edit */\n";
if (notIncludedMocs.isEmpty()) {
@@ -245,6 +235,20 @@ bool AutoMoc::run()
outStream << "#include \"" << it.value() << "\"\n";
}
}
+
+ // let all remaining moc processes finish
+ waitForProcesses();
+
+ if (failed) {
+ // if any moc process failed we don't want to touch the _automoc.cpp file so that
+ // kde4automoc is rerun until the issue is fixed
+ return false;
+ }
+ outStream.flush();
+
+ // source file that includes all remaining moc files
+ outfile.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate);
+ outfile.write(automocSource);
outfile.close();
return true;