summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppmodelmanager.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2015-04-02 11:13:49 +0200
committerNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2015-04-07 08:03:15 +0000
commitf0d891758a4cb78458cd2afbae79644f779f57ed (patch)
tree323ee4a61e0fc89fd38cf02c5443b2198e0736ae /src/plugins/cpptools/cppmodelmanager.cpp
parent27aad7dfca4ed4d782407d56c059210463d5efb9 (diff)
downloadqt-creator-f0d891758a4cb78458cd2afbae79644f779f57ed.tar.gz
CppTools: Update project part structures consistently
When the configuration (defines and includes dirs) did not change, we only updated the m_projectToProjectsInfo data structure, but not the others (m_projectFileToProjectPart, m_fileToProjectParts). Change-Id: I0ca235ea4bbe4556bd8b6d36897dedd6482f86a0 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Diffstat (limited to 'src/plugins/cpptools/cppmodelmanager.cpp')
-rw-r--r--src/plugins/cpptools/cppmodelmanager.cpp60
1 files changed, 29 insertions, 31 deletions
diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp
index 6b4f8e24c0..aad230149b 100644
--- a/src/plugins/cpptools/cppmodelmanager.cpp
+++ b/src/plugins/cpptools/cppmodelmanager.cpp
@@ -748,47 +748,45 @@ QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo &newProjectIn
if (oldProjectInfo.isValid()) {
ProjectInfoComparer comparer(oldProjectInfo, newProjectInfo);
- if (!comparer.configurationOrFilesChanged()) {
- // Some other attached data might have changed
- d->m_projectToProjectsInfo.insert(project, newProjectInfo);
- return QFuture<void>();
- }
-
- // If the project configuration changed, do a full reindexing
- if (comparer.configurationChanged()) {
- removeProjectInfoFilesAndIncludesFromSnapshot(oldProjectInfo);
- filesToReindex.unite(newSourceFiles);
-
- // The "configuration file" includes all defines and therefore should be updated
- if (comparer.definesChanged()) {
- QMutexLocker snapshotLocker(&d->m_snapshotMutex);
- d->m_snapshot.remove(configurationFileName());
+ if (comparer.configurationOrFilesChanged()) {
+ d->m_dirty = true;
+
+ // If the project configuration changed, do a full reindexing
+ if (comparer.configurationChanged()) {
+ removeProjectInfoFilesAndIncludesFromSnapshot(oldProjectInfo);
+ filesToReindex.unite(newSourceFiles);
+
+ // The "configuration file" includes all defines and therefore should be updated
+ if (comparer.definesChanged()) {
+ QMutexLocker snapshotLocker(&d->m_snapshotMutex);
+ d->m_snapshot.remove(configurationFileName());
+ }
+
+ // Otherwise check for added and modified files
+ } else {
+ const QSet<QString> addedFiles = comparer.addedFiles();
+ filesToReindex.unite(addedFiles);
+
+ const QSet<QString> modifiedFiles = comparer.timeStampModifiedFiles(snapshot());
+ filesToReindex.unite(modifiedFiles);
}
- // Otherwise check for added and modified files
- } else {
- const QSet<QString> addedFiles = comparer.addedFiles();
- filesToReindex.unite(addedFiles);
-
- const QSet<QString> modifiedFiles = comparer.timeStampModifiedFiles(snapshot());
- filesToReindex.unite(modifiedFiles);
- }
-
- // Announce and purge the removed files from the snapshot
- const QSet<QString> removedFiles = comparer.removedFiles();
- if (!removedFiles.isEmpty()) {
- filesRemoved = true;
- emit aboutToRemoveFiles(removedFiles.toList());
- removeFilesFromSnapshot(removedFiles);
+ // Announce and purge the removed files from the snapshot
+ const QSet<QString> removedFiles = comparer.removedFiles();
+ if (!removedFiles.isEmpty()) {
+ filesRemoved = true;
+ emit aboutToRemoveFiles(removedFiles.toList());
+ removeFilesFromSnapshot(removedFiles);
+ }
}
// A new project was opened/created, do a full indexing
} else {
+ d->m_dirty = true;
filesToReindex.unite(newSourceFiles);
}
// Update Project/ProjectInfo and File/ProjectPart table
- d->m_dirty = true;
d->m_projectToProjectsInfo.insert(project, newProjectInfo);
recalculateFileToProjectParts();