From 45b7c5ac293a297ff1c6c7e64b24d662ec29b7b2 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Mon, 27 Feb 2017 11:34:30 +0100 Subject: Revert "CppTools: Do not put configuration document into global snapshot and working copy" This reverts commit 05942b63f8bad6d6787fea10c31f10458cdccd06 because it breaks refactoring, e.g. Q_PROPERTY generators. Change-Id: I9a14b912ba72663f08ea99e7e066d824b18da4b0 Reviewed-by: David Schulz --- src/plugins/cpptools/cppmodelmanager.cpp | 14 +++++++++++--- 1 file changed, 11 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 4cb5ce107e..d8a197b45a 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -594,6 +594,11 @@ WorkingCopy CppModelManager::buildWorkingCopyList() workingCopy.insert(es->fileName(), es->contents(), es->revision()); } + // Add the project configuration file + QByteArray conf = codeModelConfiguration(); + conf += definedMacros(); + workingCopy.insert(configurationFileName(), conf); + return workingCopy; } @@ -871,6 +876,12 @@ QFuture CppModelManager::updateProjectInfo(QFutureInterface &futureI removeProjectInfoFilesAndIncludesFromSnapshot(oldProjectInfo); filesToReindex.unite(newSourceFiles); + // The "configuration file" includes all defines and therefore should be updated + if (comparer.definesChanged()) { + QMutexLocker snapshotLocker(&d->m_snapshotMutex); + d->m_snapshot.remove(configurationFileName()); + } + // Otherwise check for added and modified files } else { const QSet addedFiles = comparer.addedFiles(); @@ -999,9 +1010,6 @@ bool CppModelManager::isClangCodeModelActive() const void CppModelManager::emitDocumentUpdated(Document::Ptr doc) { - if (Client::isInjectedFile(doc->fileName())) - return; - if (replaceDocument(doc)) emit documentUpdated(doc); } -- cgit v1.2.1