summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppmodelmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/cpptools/cppmodelmanager.cpp')
-rw-r--r--src/plugins/cpptools/cppmodelmanager.cpp6
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);