forked from qt-creator/qt-creator
CMakeProject: Update attribute in update method
createGeneratedCodeModelSupport() can now be marked const and is renamed since it doesn't create GeneratedCodeModelSupport instances any longer. Change-Id: I8b4b8e8980623841889bd3a03e5fe8c1d4342cb3 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -280,7 +280,9 @@ void CMakeProject::updateProjectData(CMakeBuildConfiguration *bc)
|
||||
|
||||
t->updateDefaultRunConfigurations();
|
||||
|
||||
createGeneratedCodeModelSupport();
|
||||
qDeleteAll(m_extraCompilers);
|
||||
m_extraCompilers = findExtraCompilers();
|
||||
CppTools::GeneratedCodeModelSupport::update(m_extraCompilers);
|
||||
|
||||
QtSupport::CppKitInfo kitInfo(this);
|
||||
QTC_ASSERT(kitInfo.isValid(), return);
|
||||
@@ -579,10 +581,9 @@ bool CMakeProject::mustUpdateCMakeStateBeforeBuild()
|
||||
return m_delayedParsingTimer.isActive();
|
||||
}
|
||||
|
||||
void CMakeProject::createGeneratedCodeModelSupport()
|
||||
QList<ProjectExplorer::ExtraCompiler *> CMakeProject::findExtraCompilers() const
|
||||
{
|
||||
qDeleteAll(m_extraCompilers);
|
||||
m_extraCompilers.clear();
|
||||
QList<ProjectExplorer::ExtraCompiler *> extraCompilers;
|
||||
const QList<ExtraCompilerFactory *> factories =
|
||||
ExtraCompilerFactory::extraCompilerFactories();
|
||||
|
||||
@@ -612,10 +613,10 @@ void CMakeProject::createGeneratedCodeModelSupport()
|
||||
const FileNameList fileNames
|
||||
= transform(generated,
|
||||
[](const QString &s) { return FileName::fromString(s); });
|
||||
m_extraCompilers.append(factory->create(this, file, fileNames));
|
||||
extraCompilers.append(factory->create(this, file, fileNames));
|
||||
}
|
||||
|
||||
CppTools::GeneratedCodeModelSupport::update(m_extraCompilers);
|
||||
return extraCompilers;
|
||||
}
|
||||
|
||||
} // namespace CMakeProjectManager
|
||||
|
@@ -100,7 +100,7 @@ private:
|
||||
std::unique_ptr<Internal::CMakeProjectNode>
|
||||
generateProjectTree(const QList<const ProjectExplorer::FileNode*> &allFiles) const;
|
||||
|
||||
void createGeneratedCodeModelSupport();
|
||||
QList<ProjectExplorer::ExtraCompiler *> findExtraCompilers() const;
|
||||
QStringList filesGeneratedFrom(const QString &sourceFile) const final;
|
||||
|
||||
// TODO probably need a CMake specific node structure
|
||||
|
Reference in New Issue
Block a user