forked from qt-creator/qt-creator
ProjectExplorer: Refactor BuildSystem::extraCompilerForSource
Factor out backend into more generic function to easily support new accessors. No functional changes. Change-Id: I715ce2842d2c63574bdf6ada0d0e32fbfd5d08fb Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -1401,11 +1401,9 @@ void CMakeBuildSystem::runGenerator(Id id)
|
||||
proc->start();
|
||||
}
|
||||
|
||||
ExtraCompiler *CMakeBuildSystem::extraCompilerForSource(const Utils::FilePath &source)
|
||||
ExtraCompiler *CMakeBuildSystem::findExtraCompiler(const ExtraCompilerFilter &filter) const
|
||||
{
|
||||
return Utils::findOrDefault(m_extraCompilers, [source](ExtraCompiler *ec) {
|
||||
return ec->source() == source;
|
||||
});
|
||||
return Utils::findOrDefault(m_extraCompilers, filter);
|
||||
}
|
||||
|
||||
} // CMakeProjectManager::Internal
|
||||
|
||||
@@ -122,7 +122,8 @@ signals:
|
||||
private:
|
||||
QList<QPair<Utils::Id, QString>> generators() const override;
|
||||
void runGenerator(Utils::Id id) override;
|
||||
ProjectExplorer::ExtraCompiler *extraCompilerForSource(const Utils::FilePath &source) override;
|
||||
ProjectExplorer::ExtraCompiler *findExtraCompiler(
|
||||
const ExtraCompilerFilter &filter) const override;
|
||||
|
||||
enum ForceEnabledChanged { False, True };
|
||||
void clearError(ForceEnabledChanged fec = ForceEnabledChanged::False);
|
||||
|
||||
Reference in New Issue
Block a user