From c388c05b86aee9fc26d9d42cd6f51f1eaef90130 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Thu, 11 Apr 2013 11:40:07 +0200 Subject: 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 --- src/plugins/cpptools/cppmodelmanager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/cpptools/cppmodelmanager.cpp') 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); -- cgit v1.2.1