diff options
author | hjk <hjk@qt.io> | 2019-06-27 10:22:13 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2019-06-27 14:19:53 +0000 |
commit | 5dbfd46bcfe177b8308c70a66f7d404429249f6b (patch) | |
tree | 32ec9dddacc52c49b4634aad5dc41d1f2f3d3af0 /src/plugins/autotoolsprojectmanager | |
parent | f94e55b80790807a8357f50ee62751d88f80910a (diff) |
ProjectExplorer: Merge BuildConfigurationFactory::availableBuilds
... and availableSetups as far as mechanically possible.
Change-Id: Ia1d7babe943eea25da97cef7838187c234378673
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/autotoolsprojectmanager')
-rw-r--r-- | src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp | 26 | ||||
-rw-r--r-- | src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h | 9 |
2 files changed, 10 insertions, 25 deletions
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp index 9a9afa158a..a4dba21818 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp @@ -97,28 +97,18 @@ AutotoolsBuildConfigurationFactory::AutotoolsBuildConfigurationFactory() setSupportedProjectMimeTypeName(Constants::MAKEFILE_MIMETYPE); } -QList<BuildInfo> AutotoolsBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &projectPath) const -{ - return {createBuildInfo(k, projectPath)}; -} - -QList<BuildInfo> AutotoolsBuildConfigurationFactory::availableSetups(const Kit *k, const FilePath &projectPath) const -{ - const QString path = projectPath.toFileInfo().absolutePath(); - BuildInfo info = createBuildInfo(k, Utils::FilePath::fromString(path)); - //: The name of the build configuration created by default for a autotools project. - info.displayName = tr("Default"); - return {info}; -} - -BuildInfo AutotoolsBuildConfigurationFactory::createBuildInfo(const Kit *k, - const Utils::FilePath &buildDir) const +QList<BuildInfo> AutotoolsBuildConfigurationFactory::availableBuilds + (const Kit *k, const FilePath &projectPath, bool forSetup) const { BuildInfo info(this); info.typeName = tr("Build"); - info.buildDirectory = buildDir; + info.buildDirectory = forSetup ? FilePath::fromString(projectPath.toFileInfo().absolutePath()) : projectPath; info.kitId = k->id(); - return info; + if (forSetup) { + //: The name of the build configuration created by default for a autotools project. + info.displayName = tr("Default"); + } + return {info}; } BuildConfiguration::BuildType AutotoolsBuildConfiguration::buildType() const diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h index f5e83c8279..13d23834c3 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h @@ -29,8 +29,6 @@ #include <projectexplorer/buildconfiguration.h> -namespace Utils { class FilePath; } - namespace AutotoolsProjectManager { namespace Internal { @@ -54,11 +52,8 @@ public: private: 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; - - ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k, const Utils::FilePath &buildDir) const; + const Utils::FilePath &projectPath, + bool forSetup) const override; }; } // namespace Internal |