forked from qt-creator/qt-creator
ProjectExplorer: Merge BuildConfigurationFactory::availableBuilds
... and availableSetups as far as mechanically possible. Change-Id: Ia1d7babe943eea25da97cef7838187c234378673 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -369,6 +369,39 @@ QbsBuildConfigurationFactory::QbsBuildConfigurationFactory()
|
||||
});
|
||||
}
|
||||
|
||||
QList<BuildInfo> QbsBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &projectPath, bool forSetup) const
|
||||
{
|
||||
QList<BuildInfo> result;
|
||||
|
||||
if (forSetup) {
|
||||
|
||||
BuildInfo info = createBuildInfo(k, BuildConfiguration::Debug);
|
||||
//: The name of the debug build configuration created by default for a qbs project.
|
||||
info.displayName = tr("Debug");
|
||||
//: Non-ASCII characters in directory suffix may cause build issues.
|
||||
info.buildDirectory
|
||||
= defaultBuildDirectory(projectPath, k, tr("Debug", "Shadow build directory suffix"),
|
||||
info.buildType);
|
||||
result << info;
|
||||
|
||||
info = createBuildInfo(k, BuildConfiguration::Release);
|
||||
//: The name of the release build configuration created by default for a qbs project.
|
||||
info.displayName = tr("Release");
|
||||
//: Non-ASCII characters in directory suffix may cause build issues.
|
||||
info.buildDirectory
|
||||
= defaultBuildDirectory(projectPath, k, tr("Release", "Shadow build directory suffix"),
|
||||
info.buildType);
|
||||
result << info;
|
||||
|
||||
} else {
|
||||
|
||||
result << createBuildInfo(k, BuildConfiguration::Debug);
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
BuildInfo QbsBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
||||
BuildConfiguration::BuildType type) const
|
||||
{
|
||||
@@ -382,37 +415,5 @@ BuildInfo QbsBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
||||
return info;
|
||||
}
|
||||
|
||||
QList<BuildInfo>
|
||||
QbsBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &) const
|
||||
{
|
||||
return {createBuildInfo(k, BuildConfiguration::Debug)};
|
||||
}
|
||||
|
||||
QList<BuildInfo>
|
||||
QbsBuildConfigurationFactory::availableSetups(const Kit *k, const FilePath &projectPath) const
|
||||
{
|
||||
QList<BuildInfo> result;
|
||||
|
||||
BuildInfo info = createBuildInfo(k, BuildConfiguration::Debug);
|
||||
//: The name of the debug build configuration created by default for a qbs project.
|
||||
info.displayName = tr("Debug");
|
||||
//: Non-ASCII characters in directory suffix may cause build issues.
|
||||
info.buildDirectory
|
||||
= defaultBuildDirectory(projectPath, k, tr("Debug", "Shadow build directory suffix"),
|
||||
info.buildType);
|
||||
result << info;
|
||||
|
||||
info = createBuildInfo(k, BuildConfiguration::Release);
|
||||
//: The name of the release build configuration created by default for a qbs project.
|
||||
info.displayName = tr("Release");
|
||||
//: Non-ASCII characters in directory suffix may cause build issues.
|
||||
info.buildDirectory
|
||||
= defaultBuildDirectory(projectPath, k, tr("Release", "Shadow build directory suffix"),
|
||||
info.buildType);
|
||||
result << info;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace QbsProjectManager
|
||||
|
||||
@@ -92,10 +92,8 @@ class QbsBuildConfigurationFactory : public ProjectExplorer::BuildConfigurationF
|
||||
public:
|
||||
QbsBuildConfigurationFactory();
|
||||
|
||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *k,
|
||||
const Utils::FilePath &projectPath) const override;
|
||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
||||
const Utils::FilePath &projectPath) const override;
|
||||
QList<ProjectExplorer::BuildInfo> availableBuilds
|
||||
(const ProjectExplorer::Kit *k, const Utils::FilePath &projectPath, bool forSetup) const override;
|
||||
|
||||
private:
|
||||
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k,
|
||||
|
||||
Reference in New Issue
Block a user