summaryrefslogtreecommitdiff
path: root/src/qdoc/clangcodeparser.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-10-06 17:25:40 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-10-06 17:44:51 +0200
commit1c8e18b18efdfc9a4222aff591de5d86f75666bc (patch)
tree162c0509a8985bfda73908af425a97203c43a39b /src/qdoc/clangcodeparser.cpp
parent8d100101aa7e8635718d97c0621699e20e5c272e (diff)
downloadqttools-1c8e18b18efdfc9a4222aff591de5d86f75666bc.tar.gz
qdoc: Allow module header to contain more than just #includes
For some reason we can't just read this header directly, but need to parse a temporary header that includes the single module header. Change-Id: I573ebe6236b07f3df1dfde2386577dd4f2294508 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/clangcodeparser.cpp')
-rw-r--r--src/qdoc/clangcodeparser.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp
index b91a9bfe7..8a590f66b 100644
--- a/src/qdoc/clangcodeparser.cpp
+++ b/src/qdoc/clangcodeparser.cpp
@@ -1356,17 +1356,12 @@ void ClangCodeParser::buildPCH()
}
}
} else {
- QFile headerFile(header);
- if (!headerFile.open(QFile::ReadOnly)) {
- qWarning() << "Could not read module header file" << header;
+ QFileInfo headerFile(header);
+ if (!headerFile.exists()) {
+ qWarning() << "Could not find module header file" << header;
return;
}
- QTextStream in(&headerFile);
- while (!in.atEnd()) {
- QString line = in.readLine().simplified();
- if (line.startsWith(QLatin1String("#include")))
- out << line << "\n";
- }
+ out << QLatin1String("#include \"") + header + QLatin1String("\"");
}
tmpHeaderFile.close();
}