Commit a3056e89 authored by Nikolai Kosjar's avatar Nikolai Kosjar

CppTools: Fix removedProjectParts()

It compared pointers, not ids.

Change-Id: Ic77c64e452f8abfe9a35b74591f0f3baeebcf7f0
Reviewed-by: default avatarMarco Bubke <marco.bubke@theqtcompany.com>
parent 420bc697
......@@ -54,6 +54,7 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/algorithm.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h>
......@@ -710,13 +711,11 @@ void CppModelManager::removeFilesFromSnapshot(const QSet<QString> &filesToRemove
d->m_snapshot.remove(i.next());
}
static QStringList projectPartIds(const QSet<ProjectPart::Ptr> &projectParts)
static QSet<QString> projectPartIds(const QSet<ProjectPart::Ptr> &projectParts)
{
QStringList result;
QSetIterator<ProjectPart::Ptr> it(projectParts);
while (it.hasNext())
result << it.next()->id();
return result;
return Utils::transform(projectParts, [](const ProjectPart::Ptr &projectPart) {
return projectPart->id();
});
}
class ProjectInfoComparer
......@@ -750,9 +749,9 @@ public:
QStringList removedProjectParts()
{
QSet<ProjectPart::Ptr> removed = m_old.projectParts().toSet();
removed.subtract(m_new.projectParts().toSet());
return projectPartIds(removed);
QSet<QString> removed = projectPartIds(m_old.projectParts().toSet());
removed.subtract(projectPartIds(m_new.projectParts().toSet()));
return removed.toList();
}
/// Returns a list of common files that have a changed timestamp.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment