Clang: Fix updating supportive translation unit

...with new project arguments.

Reproduce with:
 1. Open a file with some #ifdef
 2. Edit the file, e.g. type space.
 3. Change the build configuration so that the highlighting flips in the
    editor.
 4. Edit the file again, the configuration flips again [repeat].

Change-Id: Ib97c18fc46538d74c63972e682a348ae2736a4e6
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Nikolai Kosjar
2017-05-03 15:48:44 +02:00
parent fda21898fb
commit cf0e3f2db3
9 changed files with 61 additions and 10 deletions

View File

@@ -185,10 +185,16 @@ void Documents::updateDocumentsWithChangedDependencies(const QVector<FileContain
updateDocumentsWithChangedDependency(fileContainer.filePath());
}
void Documents::setDocumentsDirtyIfProjectPartChanged()
std::vector<Document> Documents::setDocumentsDirtyIfProjectPartChanged()
{
for (auto &document : documents_)
document.setDirtyIfProjectPartIsOutdated();
std::vector<Document> notDirtyBefore;
for (auto &document : documents_) {
if (!document.isDirty() && document.setDirtyIfProjectPartIsOutdated())
notDirtyBefore.push_back(document);
}
return notDirtyBefore;
}
QVector<FileContainer> Documents::newerFileContainers(const QVector<FileContainer> &fileContainers) const