forked from qt-creator/qt-creator
C++: fixed source-to-project-part map calculation
When the information for a project is updated, the mapping was cleared and only recalculated for the new project info. Thereby wiping out the info for any previously added project. Change-Id: Ic6999b9be07f8cb6b4638723e6c8c7d2d3ca52e7 Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
This commit is contained in:
@@ -934,11 +934,10 @@ void CppModelManager::updateProjectInfo(const ProjectInfo &pinfo)
|
||||
|
||||
m_srcToProjectPart.clear();
|
||||
|
||||
foreach (const ProjectPart::Ptr &projectPart, pinfo.projectParts()) {
|
||||
foreach (const QString &sourceFile, projectPart->sourceFiles) {
|
||||
m_srcToProjectPart[sourceFile].append(projectPart);
|
||||
}
|
||||
}
|
||||
foreach (const ProjectInfo &projectInfo, m_projects.values())
|
||||
foreach (const ProjectPart::Ptr &projectPart, projectInfo.projectParts())
|
||||
foreach (const QString &sourceFile, projectPart->sourceFiles)
|
||||
m_srcToProjectPart[sourceFile].append(projectPart);
|
||||
}
|
||||
|
||||
QList<CppModelManager::ProjectPart::Ptr> CppModelManager::projectPart(const QString &fileName) const
|
||||
|
Reference in New Issue
Block a user