aboutsummaryrefslogtreecommitdiff
path: root/automoc/kde4automoc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'automoc/kde4automoc.cpp')
-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;