diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2013-04-11 11:40:07 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2013-04-11 12:15:07 +0200 |
commit | c388c05b86aee9fc26d9d42cd6f51f1eaef90130 (patch) | |
tree | 4503deda82a0ce358c37b480804276fe35119447 /src/plugins/cpptools/cppmodelmanager.cpp | |
parent | 8ba344a556d3196dd3c8f320795cc3e46517b585 (diff) | |
download | qt-creator-c388c05b86aee9fc26d9d42cd6f51f1eaef90130.tar.gz |
C++: fix the quick-exit for already parsed files.
When the preprocessor is asked to process a file which it has already
seen before, it can skip it, but it still has to add the file to the
list of included files for the current document.
Task-number: QTCREATORBUG-9107
Change-Id: I30cac61c1da20da7fe925168ecccb429584e9746
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Diffstat (limited to 'src/plugins/cpptools/cppmodelmanager.cpp')
-rw-r--r-- | src/plugins/cpptools/cppmodelmanager.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index 568df9a4a4..e382171c39 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -511,17 +511,17 @@ void CppPreprocessor::sourceNeeded(unsigned line, const QString &fileName, Inclu return; QString absoluteFileName = resolveFile(fileName, type); + absoluteFileName = QDir::cleanPath(absoluteFileName); + if (m_currentDoc && !absoluteFileName.isEmpty()) + m_currentDoc->addIncludeFile(absoluteFileName, line); if (m_included.contains(absoluteFileName)) return; // we've already seen this file. m_included.insert(absoluteFileName); - absoluteFileName = QDir::cleanPath(absoluteFileName); unsigned editorRevision = 0; QString contents; getFileContents(absoluteFileName, &contents, &editorRevision); if (m_currentDoc) { - m_currentDoc->addIncludeFile(absoluteFileName, line); - if (contents.isEmpty() && ! QFileInfo(absoluteFileName).isAbsolute()) { QString msg = QCoreApplication::translate( "CppPreprocessor", "%1: No such file or directory").arg(fileName); |