summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppmodelmanager.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@qt.io>2016-12-06 13:07:00 +0100
committerNikolai Kosjar <nikolai.kosjar@qt.io>2016-12-06 14:34:39 +0000
commit521423b43313459f5e9c75d0720945cc37f6ef8c (patch)
tree546b279ebe1041e9b99ca9108090f4470aebcc19 /src/plugins/cpptools/cppmodelmanager.cpp
parentd006fc41493187b75d014d3865969be5efbc3a0c (diff)
downloadqt-creator-521423b43313459f5e9c75d0720945cc37f6ef8c.tar.gz
CppTools: Call ProjectInfo::finish when we get it
No need to require the project managers to do this. Also, it is easy to forget. Change-Id: I96f7a5e5547418678af9653e5753c372f0880e5a Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/plugins/cpptools/cppmodelmanager.cpp')
-rw-r--r--src/plugins/cpptools/cppmodelmanager.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp
index ac0003e3dd..201af6f6a2 100644
--- a/src/plugins/cpptools/cppmodelmanager.cpp
+++ b/src/plugins/cpptools/cppmodelmanager.cpp
@@ -823,21 +823,24 @@ QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo &newProjectIn
if (!newProjectInfo.isValid())
return QFuture<void>();
+ ProjectInfo theNewProjectInfo = newProjectInfo;
+ theNewProjectInfo.finish();
+
QSet<QString> filesToReindex;
QStringList removedProjectParts;
bool filesRemoved = false;
- ProjectExplorer::Project *project = newProjectInfo.project().data();
+ ProjectExplorer::Project *project = theNewProjectInfo.project().data();
{ // Only hold the mutex for a limited scope, so the dumping afterwards does not deadlock.
QMutexLocker projectLocker(&d->m_projectMutex);
- const QSet<QString> newSourceFiles = newProjectInfo.sourceFiles();
+ const QSet<QString> newSourceFiles = theNewProjectInfo.sourceFiles();
// Check if we can avoid a full reindexing
ProjectInfo oldProjectInfo = d->m_projectToProjectsInfo.value(project);
const bool previousIndexerCanceled = d->m_projectToIndexerCanceled.value(project, false);
if (!previousIndexerCanceled && oldProjectInfo.isValid()) {
- ProjectInfoComparer comparer(oldProjectInfo, newProjectInfo);
+ ProjectInfoComparer comparer(oldProjectInfo, theNewProjectInfo);
if (comparer.configurationOrFilesChanged()) {
d->m_dirty = true;
@@ -880,7 +883,7 @@ QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo &newProjectIn
}
// Update Project/ProjectInfo and File/ProjectPart table
- d->m_projectToProjectsInfo.insert(project, newProjectInfo);
+ d->m_projectToProjectsInfo.insert(project, theNewProjectInfo);
recalculateProjectPartMappings();
} // Mutex scope
@@ -898,7 +901,7 @@ QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo &newProjectIn
emit projectPartsRemoved(removedProjectParts);
// Announce added project parts
- emit projectPartsUpdated(newProjectInfo.project().data());
+ emit projectPartsUpdated(theNewProjectInfo.project().data());
// Ideally, we would update all the editor documents that depend on the 'filesToReindex'.
// However, on e.g. a session restore first the editor documents are created and then the