ProjectExplorer: Fix Project::setExtraProjectFiles()

This function was buggy and could erroneously un-watch all the project
files after the first update.

Change-Id: I528fd8da7f873598e08f4c0177757a052fbb97ef
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2020-03-02 15:13:25 +01:00
parent c7e2ba9c14
commit 757628bf4a

View File

@@ -362,8 +362,8 @@ void Project::setExtraProjectFiles(const QVector<Utils::FilePath> &projectDocume
QSet<Utils::FilePath> existingWatches = Utils::transform<QSet>(d->m_extraProjectDocuments,
&Core::IDocument::filePath);
QSet<Utils::FilePath> toAdd = uniqueNewFiles.subtract(existingWatches);
QSet<Utils::FilePath> toRemove = existingWatches.subtract(uniqueNewFiles);
const QSet<Utils::FilePath> toAdd = uniqueNewFiles - existingWatches;
const QSet<Utils::FilePath> toRemove = existingWatches - uniqueNewFiles;
Utils::erase(d->m_extraProjectDocuments, [&toRemove](const std::unique_ptr<Core::IDocument> &d) {
return toRemove.contains(d->filePath());