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

@@ -75,20 +75,19 @@ AutotoolsBuildConfigurationFactory::AutotoolsBuildConfigurationFactory()
setSupportedProjectType(Constants::AUTOTOOLS_PROJECT_ID);
setSupportedProjectMimeTypeName(Constants::MAKEFILE_MIMETYPE);
}
QList<BuildInfo> AutotoolsBuildConfigurationFactory::availableBuilds
(const Kit *k, const FilePath &projectPath, bool forSetup) const
{
BuildInfo info(this);
info.typeName = tr("Build");
info.buildDirectory = forSetup ? FilePath::fromString(projectPath.toFileInfo().absolutePath()) : projectPath;
info.kitId = k->id();
if (forSetup) {
//: The name of the build configuration created by default for a autotools project.
info.displayName = tr("Default");
}
return {info};
setBuildGenerator([this](const Kit *k, const FilePath &projectPath, bool forSetup) {
BuildInfo info(this);
info.typeName = tr("Build");
info.buildDirectory = forSetup
? FilePath::fromString(projectPath.toFileInfo().absolutePath()) : projectPath;
info.kitId = k->id();
if (forSetup) {
//: The name of the build configuration created by default for a autotools project.
info.displayName = tr("Default");
}
return QList<BuildInfo>{info};
});
}
} // Internal