From 757628bf4a4a323d580f05e2362ebeed3415603b Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 2 Mar 2020 15:13:25 +0100 Subject: [PATCH] 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 --- src/plugins/projectexplorer/project.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 292f81a4cd4..5e511fcedaf 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -362,8 +362,8 @@ void Project::setExtraProjectFiles(const QVector &projectDocume QSet existingWatches = Utils::transform(d->m_extraProjectDocuments, &Core::IDocument::filePath); - QSet toAdd = uniqueNewFiles.subtract(existingWatches); - QSet toRemove = existingWatches.subtract(uniqueNewFiles); + const QSet toAdd = uniqueNewFiles - existingWatches; + const QSet toRemove = existingWatches - uniqueNewFiles; Utils::erase(d->m_extraProjectDocuments, [&toRemove](const std::unique_ptr &d) { return toRemove.contains(d->filePath());