summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp26
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h9
-rw-r--r--src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp32
-rw-r--r--src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h5
-rw-r--r--src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp22
-rw-r--r--src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.h7
-rw-r--r--src/plugins/genericprojectmanager/genericbuildconfiguration.cpp31
-rw-r--r--src/plugins/genericprojectmanager/genericbuildconfiguration.h8
-rw-r--r--src/plugins/nim/project/nimbuildconfiguration.cpp52
-rw-r--r--src/plugins/nim/project/nimbuildconfiguration.h11
-rw-r--r--src/plugins/projectexplorer/buildconfiguration.cpp4
-rw-r--r--src/plugins/projectexplorer/buildconfiguration.h4
-rw-r--r--src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp65
-rw-r--r--src/plugins/qbsprojectmanager/qbsbuildconfiguration.h6
-rw-r--r--src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp30
-rw-r--r--src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h5
-rw-r--r--src/plugins/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp8
17 files changed, 117 insertions, 208 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
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
index 74e643bfbe..c7c2f5e84a 100644
--- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
@@ -481,31 +481,21 @@ BuildConfiguration::BuildType CMakeBuildConfigurationFactory::cmakeBuildTypeToBu
return BuildConfiguration::Unknown;
}
-QList<BuildInfo>
- CMakeBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &projectPath) const
+QList<BuildInfo> CMakeBuildConfigurationFactory::availableBuilds
+ (const Kit *k, const FilePath &projectPath, bool forSetup) const
{
QList<BuildInfo> result;
- for (int type = BuildTypeNone; type != BuildTypeLast; ++type) {
- result << createBuildInfo(k,
- projectPath.toString(),
- BuildType(type));
- }
- return result;
-}
+ FilePath path = forSetup ? Project::projectDirectory(projectPath) : projectPath;
-QList<BuildInfo>
- CMakeBuildConfigurationFactory::availableSetups(const Kit *k, const FilePath &projectPath) const
-{
- QList<BuildInfo> result;
- for (int type = BuildTypeDebug; type != BuildTypeLast; ++type) {
- BuildInfo info = createBuildInfo(k,
- ProjectExplorer::Project::projectDirectory(projectPath).toString(),
- BuildType(type));
- info.displayName = info.typeName;
- info.buildDirectory
- = CMakeBuildConfiguration::shadowBuildDirectory(projectPath, k,
- info.displayName, info.buildType);
+ for (int type = BuildTypeNone; type != BuildTypeLast; ++type) {
+ BuildInfo info = createBuildInfo(k, path.toString(), BuildType(type));
+ if (forSetup) {
+ info.displayName = info.typeName;
+ info.buildDirectory
+ = CMakeBuildConfiguration::shadowBuildDirectory(projectPath, k,
+ info.displayName, info.buildType);
+ }
result << info;
}
return result;
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h
index 5c67908070..78f5986556 100644
--- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h
+++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h
@@ -135,9 +135,8 @@ public:
static ProjectExplorer::BuildConfiguration::BuildType cmakeBuildTypeToBuildType(const BuildType &in);
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;
+ const Utils::FilePath &projectPath,
+ bool forSetup) const override;
private:
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k,
diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp
index 95cc20b2c0..c1c9ddcaa3 100644
--- a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp
+++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp
@@ -59,6 +59,7 @@
#endif
using namespace ProjectExplorer;
+using namespace Utils;
namespace CompilationDatabaseProjectManager {
namespace Internal {
@@ -529,26 +530,15 @@ CompilationDatabaseBuildConfigurationFactory::CompilationDatabaseBuildConfigurat
setSupportedProjectMimeTypeName(Constants::COMPILATIONDATABASEMIMETYPE);
}
-static QList<ProjectExplorer::BuildInfo> defaultBuildInfos(
- const ProjectExplorer::BuildConfigurationFactory *factory, const QString &name)
+QList<BuildInfo> CompilationDatabaseBuildConfigurationFactory::availableBuilds
+ (const Kit *, const FilePath &, bool) const
{
- ProjectExplorer::BuildInfo info(factory);
+ const QString name = tr("Release");
+ ProjectExplorer::BuildInfo info(this);
info.typeName = name;
info.displayName = name;
info.buildType = BuildConfiguration::Release;
- QList<ProjectExplorer::BuildInfo> buildInfos;
- buildInfos << info;
- return buildInfos;
-}
-
-QList<BuildInfo> CompilationDatabaseBuildConfigurationFactory::availableBuilds(const Kit *, const Utils::FilePath &) const
-{
- return defaultBuildInfos(this, tr("Release"));
-}
-
-QList<BuildInfo> CompilationDatabaseBuildConfigurationFactory::availableSetups(const Kit *, const Utils::FilePath &) const
-{
- return defaultBuildInfos(this, tr("Release"));
+ return {info};
}
} // namespace Internal
diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.h b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.h
index 84754e3dbf..7597e78cc3 100644
--- a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.h
+++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.h
@@ -104,10 +104,9 @@ class CompilationDatabaseBuildConfigurationFactory
public:
CompilationDatabaseBuildConfigurationFactory();
- 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;
};
} // namespace Internal
diff --git a/src/plugins/genericprojectmanager/genericbuildconfiguration.cpp b/src/plugins/genericprojectmanager/genericbuildconfiguration.cpp
index 3ed467108f..2a32a1265e 100644
--- a/src/plugins/genericprojectmanager/genericbuildconfiguration.cpp
+++ b/src/plugins/genericprojectmanager/genericbuildconfiguration.cpp
@@ -85,31 +85,20 @@ GenericBuildConfigurationFactory::GenericBuildConfigurationFactory()
setSupportedProjectMimeTypeName(Constants::GENERICMIMETYPE);
}
-GenericBuildConfigurationFactory::~GenericBuildConfigurationFactory() = default;
-
-QList<BuildInfo>
- GenericBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &projectPath) const
-{
- return {createBuildInfo(k, projectPath)};
-}
-
-QList<BuildInfo>
- GenericBuildConfigurationFactory::availableSetups(const Kit *k, const FilePath &projectPath) const
-{
- BuildInfo info = createBuildInfo(k, Project::projectDirectory(projectPath));
- //: The name of the build configuration created by default for a generic project.
- info.displayName = tr("Default");
- return {info};
-}
-
-BuildInfo
- GenericBuildConfigurationFactory::createBuildInfo(const Kit *k, const FilePath &buildDir) const
+QList<BuildInfo> GenericBuildConfigurationFactory::availableBuilds
+ (const Kit *k, const FilePath &projectPath, bool forSetup) const
{
BuildInfo info(this);
info.typeName = tr("Build");
- info.buildDirectory = buildDir;
+ info.buildDirectory = forSetup ? Project::projectDirectory(projectPath) : projectPath;
info.kitId = k->id();
- return info;
+
+ if (forSetup) {
+ //: The name of the build configuration created by default for a generic project.
+ info.displayName = tr("Default");
+ }
+
+ return {info};
}
BuildConfiguration::BuildType GenericBuildConfiguration::buildType() const
diff --git a/src/plugins/genericprojectmanager/genericbuildconfiguration.h b/src/plugins/genericprojectmanager/genericbuildconfiguration.h
index facb74f178..be04937315 100644
--- a/src/plugins/genericprojectmanager/genericbuildconfiguration.h
+++ b/src/plugins/genericprojectmanager/genericbuildconfiguration.h
@@ -50,15 +50,11 @@ class GenericBuildConfigurationFactory : public ProjectExplorer::BuildConfigurat
public:
GenericBuildConfigurationFactory();
- ~GenericBuildConfigurationFactory() override;
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
diff --git a/src/plugins/nim/project/nimbuildconfiguration.cpp b/src/plugins/nim/project/nimbuildconfiguration.cpp
index 2d49e8626d..f03552af10 100644
--- a/src/plugins/nim/project/nimbuildconfiguration.cpp
+++ b/src/plugins/nim/project/nimbuildconfiguration.cpp
@@ -155,48 +155,30 @@ NimBuildConfigurationFactory::NimBuildConfigurationFactory()
setSupportedProjectMimeTypeName(Constants::C_NIM_PROJECT_MIMETYPE);
}
-QList<BuildInfo> NimBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &) const
-{
- QList<BuildInfo> result;
- for (auto buildType : {BuildConfiguration::Debug, BuildConfiguration::Release})
- result.push_back(createBuildInfo(k, buildType));
- return result;
-}
-
-QList<BuildInfo> NimBuildConfigurationFactory::availableSetups(const Kit *k, const FilePath &projectPath) const
+QList<BuildInfo> NimBuildConfigurationFactory::availableBuilds
+ (const Kit *k, const FilePath &projectPath, bool forSetup) const
{
QList<BuildInfo> result;
for (auto buildType : {BuildConfiguration::Debug, BuildConfiguration::Release}) {
- BuildInfo info = createBuildInfo(k, buildType);
- info.displayName = info.typeName;
- info.buildDirectory = defaultBuildDirectory(k, projectPath, info.typeName, buildType);
+ BuildInfo info(this);
+ info.buildType = buildType;
+ info.kitId = k->id();
+
+ if (buildType == BuildConfiguration::Debug)
+ info.typeName = tr("Debug");
+ else if (buildType == BuildConfiguration::Profile)
+ info.typeName = tr("Profile");
+ else if (buildType == BuildConfiguration::Release)
+ info.typeName = tr("Release");
+
+ if (forSetup) {
+ info.displayName = info.typeName;
+ info.buildDirectory = defaultBuildDirectory(k, projectPath, info.typeName, buildType);
+ }
result.push_back(info);
}
return result;
}
-BuildInfo NimBuildConfigurationFactory::createBuildInfo(const Kit *k, BuildConfiguration::BuildType buildType) const
-{
- BuildInfo info(this);
- info.buildType = buildType;
- info.kitId = k->id();
- info.typeName = displayName(buildType);
- return info;
-}
-
-QString NimBuildConfigurationFactory::displayName(BuildConfiguration::BuildType buildType) const
-{
- switch (buildType) {
- case ProjectExplorer::BuildConfiguration::Debug:
- return tr("Debug");
- case ProjectExplorer::BuildConfiguration::Profile:
- return tr("Profile");
- case ProjectExplorer::BuildConfiguration::Release:
- return tr("Release");
- default:
- return QString();
- }
-}
-
} // namespace Nim
diff --git a/src/plugins/nim/project/nimbuildconfiguration.h b/src/plugins/nim/project/nimbuildconfiguration.h
index ba750d6776..fd988023c3 100644
--- a/src/plugins/nim/project/nimbuildconfiguration.h
+++ b/src/plugins/nim/project/nimbuildconfiguration.h
@@ -64,15 +64,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,
- ProjectExplorer::BuildConfiguration::BuildType buildType) const;
-
- QString displayName(ProjectExplorer::BuildConfiguration::BuildType buildType) const;
+ const Utils::FilePath &projectPath,
+ bool forSetup) const override;
};
}
diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp
index 0bea346bf0..ef460eef58 100644
--- a/src/plugins/projectexplorer/buildconfiguration.cpp
+++ b/src/plugins/projectexplorer/buildconfiguration.cpp
@@ -416,13 +416,13 @@ const Tasks BuildConfigurationFactory::reportIssues(ProjectExplorer::Kit *kit, c
const QList<BuildInfo> BuildConfigurationFactory::allAvailableBuilds(const Target *parent) const
{
- return availableBuilds(parent->kit(), parent->project()->projectFilePath());
+ return availableBuilds(parent->kit(), parent->project()->projectFilePath(), false);
}
const QList<BuildInfo>
BuildConfigurationFactory::allAvailableSetups(const Kit *k, const FilePath &projectPath) const
{
- return availableSetups(k, projectPath);
+ return availableBuilds(k, projectPath, /* forSetup = */ true);
}
bool BuildConfigurationFactory::supportsTargetDeviceType(Core::Id id) const
diff --git a/src/plugins/projectexplorer/buildconfiguration.h b/src/plugins/projectexplorer/buildconfiguration.h
index d2edce03cd..0e04db8ddf 100644
--- a/src/plugins/projectexplorer/buildconfiguration.h
+++ b/src/plugins/projectexplorer/buildconfiguration.h
@@ -158,9 +158,7 @@ public:
protected:
virtual QList<BuildInfo>
- availableBuilds(const Kit *k, const Utils::FilePath &projectPath) const = 0;
- virtual QList<BuildInfo>
- availableSetups(const Kit *k, const Utils::FilePath &projectPath) const = 0;
+ availableBuilds(const Kit *k, const Utils::FilePath &projectPath, bool forSetup) const = 0;
bool supportsTargetDeviceType(Core::Id id) const;
void setSupportedProjectType(Core::Id id);
diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp
index 3ebed18a1c..d87c79d1c0 100644
--- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp
+++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp
@@ -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
diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h
index 7f3f96c285..0b962615cb 100644
--- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h
+++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h
@@ -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,
diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp
index 1285cbc8ce..713b9a6c07 100644
--- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp
@@ -665,29 +665,25 @@ static const QList<BuildConfiguration::BuildType> availableBuildTypes(const Base
return types;
}
-QList<BuildInfo> QmakeBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &projectPath) const
+QList<BuildInfo> QmakeBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &projectPath, bool forSetup) const
{
QList<BuildInfo> result;
- for (BuildConfiguration::BuildType buildType : availableBuildTypes(QtKitAspect::qtVersion(k))) {
- BuildInfo info = createBuildInfo(k, projectPath, buildType);
- info.displayName.clear(); // ask for a name
- info.buildDirectory.clear(); // This depends on the displayName
- result << info;
- }
+ BaseQtVersion *qtVersion = QtKitAspect::qtVersion(k);
- return result;
-}
+ if (forSetup && (!qtVersion || !qtVersion->isValid()))
+ return {};
-QList<BuildInfo> QmakeBuildConfigurationFactory::availableSetups(const Kit *k, const FilePath &projectPath) const
-{
- QList<BuildInfo> result;
- BaseQtVersion *qtVersion = QtKitAspect::qtVersion(k);
- if (!qtVersion || !qtVersion->isValid())
- return result;
- for (BuildConfiguration::BuildType buildType : availableBuildTypes(qtVersion))
- result << createBuildInfo(k, projectPath, buildType);
+ for (BuildConfiguration::BuildType buildType : availableBuildTypes(qtVersion)) {
+ BuildInfo info = createBuildInfo(k, projectPath, buildType);
+ if (!forSetup) {
+ info.displayName.clear(); // ask for a name
+ info.buildDirectory.clear(); // This depends on the displayName
+ }
+ result << info;
+
+ }
return result;
}
diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h
index 867f72afdb..cc63a56713 100644
--- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h
+++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h
@@ -150,9 +150,8 @@ public:
QmakeBuildConfigurationFactory();
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;
+ const Utils::FilePath &projectPath,
+ bool forSetup) const override;
private:
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k, const Utils::FilePath &projectPath,
ProjectExplorer::BuildConfiguration::BuildType type) const;
diff --git a/src/plugins/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp b/src/plugins/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp
index 049c84d47c..55787e918b 100644
--- a/src/plugins/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp
+++ b/src/plugins/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp
@@ -72,13 +72,7 @@ class DummyBuildConfigurationFactory : public ProjectExplorer::BuildConfiguratio
{
public:
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *,
- const FilePath &) const final
- {
- return {};
- }
-
- QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *,
- const FilePath &) const final
+ const FilePath &, bool) const final
{
return {};
}