summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppsnapshotupdater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/cpptools/cppsnapshotupdater.cpp')
-rw-r--r--src/plugins/cpptools/cppsnapshotupdater.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/plugins/cpptools/cppsnapshotupdater.cpp b/src/plugins/cpptools/cppsnapshotupdater.cpp
index cf4a7cec74..11cd3ff5b3 100644
--- a/src/plugins/cpptools/cppsnapshotupdater.cpp
+++ b/src/plugins/cpptools/cppsnapshotupdater.cpp
@@ -138,7 +138,8 @@ void SnapshotUpdater::update(CppModelManager::WorkingCopy workingCopy)
workingCopy.insert(configurationFileName, m_configFile);
m_snapshot.remove(m_fileInEditor);
- static const QString editorDefinesFileName = QLatin1String("<per-editor-defines>");
+ static const QString editorDefinesFileName
+ = CppModelManagerInterface::editorConfigurationFileName();
if (editorDefinesChanged) {
m_snapshot.remove(editorDefinesFileName);
workingCopy.insert(editorDefinesFileName, m_editorDefines);
@@ -152,15 +153,21 @@ void SnapshotUpdater::update(CppModelManager::WorkingCopy workingCopy)
preproc.setIncludePaths(m_includePaths);
preproc.setFrameworkPaths(m_frameworkPaths);
preproc.run(configurationFileName);
- if (m_usePrecompiledHeaders)
+ if (m_usePrecompiledHeaders) {
foreach (const QString &precompiledHeader, m_precompiledHeaders)
preproc.run(precompiledHeader);
+ }
if (!m_editorDefines.isEmpty())
preproc.run(editorDefinesFileName);
preproc.run(m_fileInEditor);
m_snapshot = preproc.snapshot();
- m_snapshot = m_snapshot.simplified(document());
+ Snapshot newSnapshot = m_snapshot.simplified(document());
+ for (Snapshot::const_iterator i = m_snapshot.begin(), ei = m_snapshot.end(); i != ei; ++i) {
+ if (Client::isInjectedFile(i.key()))
+ newSnapshot.insert(i.value());
+ }
+ m_snapshot = newSnapshot;
m_deps.build(m_snapshot);
foreach (Document::Ptr doc, m_snapshot) {