ProjectExplorer: Replace BuildConfigurationFactory::availableBuilds

... by a function object.

Change-Id: I9953ba6915c0177e7c4067d36dd755fc2ba5cf84
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2020-01-09 15:06:30 +01:00
parent ce69a9af83
commit a971da3bfe
19 changed files with 149 additions and 195 deletions

View File

@@ -76,22 +76,20 @@ GenericBuildConfigurationFactory::GenericBuildConfigurationFactory()
setSupportedProjectType(Constants::GENERICPROJECT_ID);
setSupportedProjectMimeTypeName(Constants::GENERICMIMETYPE);
}
QList<BuildInfo> GenericBuildConfigurationFactory::availableBuilds
(const Kit *k, const FilePath &projectPath, bool forSetup) const
{
BuildInfo info(this);
info.typeName = tr("Build");
info.buildDirectory = forSetup ? Project::projectDirectory(projectPath) : projectPath;
info.kitId = k->id();
setBuildGenerator([this](const Kit *k, const FilePath &projectPath, bool forSetup) {
BuildInfo info(this);
info.typeName = tr("Build");
info.buildDirectory = forSetup ? Project::projectDirectory(projectPath) : projectPath;
info.kitId = k->id();
if (forSetup) {
//: The name of the build configuration created by default for a generic project.
info.displayName = tr("Default");
}
if (forSetup) {
//: The name of the build configuration created by default for a generic project.
info.displayName = tr("Default");
}
return {info};
return QList<BuildInfo>{info};
});
}
void GenericBuildConfiguration::addToEnvironment(Utils::Environment &env) const