forked from qt-creator/qt-creator
CppEditor: Use the project part chosen with CppPreProcessorDialog
...otherwise the CppPreProcessorDialog is only semi-useful. Change-Id: I6b80967b05e7c9a51cd78ae064a3d78170948e32 Reviewed-by: David Schulz <david.schulz@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -689,12 +689,14 @@ private:
|
||||
/// Make sure that m_projectMutex is locked when calling this.
|
||||
void CppModelManager::recalculateFileToProjectParts()
|
||||
{
|
||||
m_projectFileToProjectPart.clear();
|
||||
m_fileToProjectParts.clear();
|
||||
foreach (const ProjectInfo &projectInfo, m_projectToProjectsInfo) {
|
||||
foreach (const ProjectPart::Ptr &projectPart, projectInfo.projectParts()) {
|
||||
foreach (const ProjectFile &cxxFile, projectPart->files) {
|
||||
m_projectFileToProjectPart[projectPart->projectFile] = projectPart;
|
||||
foreach (const ProjectFile &cxxFile, projectPart->files)
|
||||
m_fileToProjectParts[cxxFile.path].append(projectPart);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -774,6 +776,11 @@ QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo &newProjectIn
|
||||
return updateSourceFiles(filesToReindex, ForcedProgressNotification);
|
||||
}
|
||||
|
||||
ProjectPart::Ptr CppModelManager::projectPartForProjectFile(const QString &projectFile) const
|
||||
{
|
||||
return m_projectFileToProjectPart.value(projectFile);
|
||||
}
|
||||
|
||||
QList<ProjectPart::Ptr> CppModelManager::projectPart(const QString &fileName) const
|
||||
{
|
||||
return m_fileToProjectParts.value(fileName);
|
||||
|
||||
Reference in New Issue
Block a user