forked from qt-creator/qt-creator
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:
@@ -362,8 +362,8 @@ void Project::setExtraProjectFiles(const QVector<Utils::FilePath> &projectDocume
|
|||||||
QSet<Utils::FilePath> existingWatches = Utils::transform<QSet>(d->m_extraProjectDocuments,
|
QSet<Utils::FilePath> existingWatches = Utils::transform<QSet>(d->m_extraProjectDocuments,
|
||||||
&Core::IDocument::filePath);
|
&Core::IDocument::filePath);
|
||||||
|
|
||||||
QSet<Utils::FilePath> toAdd = uniqueNewFiles.subtract(existingWatches);
|
const QSet<Utils::FilePath> toAdd = uniqueNewFiles - existingWatches;
|
||||||
QSet<Utils::FilePath> toRemove = existingWatches.subtract(uniqueNewFiles);
|
const QSet<Utils::FilePath> toRemove = existingWatches - uniqueNewFiles;
|
||||||
|
|
||||||
Utils::erase(d->m_extraProjectDocuments, [&toRemove](const std::unique_ptr<Core::IDocument> &d) {
|
Utils::erase(d->m_extraProjectDocuments, [&toRemove](const std::unique_ptr<Core::IDocument> &d) {
|
||||||
return toRemove.contains(d->filePath());
|
return toRemove.contains(d->filePath());
|
||||||
|
Reference in New Issue
Block a user