forked from qt-creator/qt-creator
ProjectExplorer: remove confusing function from Project
Change-Id: Ifaed5d8293dadd2ae3cfdab3b027434d4f8caa3e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -1593,9 +1593,8 @@ FilePath CMakeBuildConfiguration::shadowBuildDirectory(const FilePath &projectFi
|
|||||||
return {};
|
return {};
|
||||||
|
|
||||||
const QString projectName = projectFilePath.parentDir().fileName();
|
const QString projectName = projectFilePath.parentDir().fileName();
|
||||||
const FilePath projectDir = Project::projectDirectory(projectFilePath);
|
FilePath buildPath = buildDirectoryFromTemplate(
|
||||||
FilePath buildPath = buildDirectoryFromTemplate(projectDir, projectFilePath, projectName, k,
|
projectFilePath.absolutePath(), projectFilePath, projectName, k, bcName, buildType, "cmake");
|
||||||
bcName, buildType, "cmake");
|
|
||||||
|
|
||||||
if (CMakeGeneratorKitAspect::isMultiConfigGenerator(k)) {
|
if (CMakeGeneratorKitAspect::isMultiConfigGenerator(k)) {
|
||||||
const QString path = buildPath.path();
|
const QString path = buildPath.path();
|
||||||
@@ -1906,8 +1905,6 @@ CMakeBuildConfigurationFactory::CMakeBuildConfigurationFactory()
|
|||||||
setBuildGenerator([](const Kit *k, const FilePath &projectPath, bool forSetup) {
|
setBuildGenerator([](const Kit *k, const FilePath &projectPath, bool forSetup) {
|
||||||
QList<BuildInfo> result;
|
QList<BuildInfo> result;
|
||||||
|
|
||||||
FilePath path = forSetup ? Project::projectDirectory(projectPath) : projectPath;
|
|
||||||
|
|
||||||
// Skip the default shadow build directories for build types if we have presets
|
// Skip the default shadow build directories for build types if we have presets
|
||||||
const CMakeConfigItem presetItem = CMakeConfigurationKitAspect::cmakePresetConfigItem(k);
|
const CMakeConfigItem presetItem = CMakeConfigurationKitAspect::cmakePresetConfigItem(k);
|
||||||
if (!presetItem.isNull())
|
if (!presetItem.isNull())
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public:
|
|||||||
setBuildGenerator([](const Kit *, const FilePath &projectPath, bool forSetup) {
|
setBuildGenerator([](const Kit *, const FilePath &projectPath, bool forSetup) {
|
||||||
BuildInfo info;
|
BuildInfo info;
|
||||||
info.typeName = ProjectExplorer::Tr::tr("Build");
|
info.typeName = ProjectExplorer::Tr::tr("Build");
|
||||||
info.buildDirectory = forSetup ? Project::projectDirectory(projectPath) : projectPath;
|
info.buildDirectory = forSetup ? projectPath.absolutePath() : projectPath;
|
||||||
|
|
||||||
if (forSetup) {
|
if (forSetup) {
|
||||||
//: The name of the build configuration created by default for a generic project.
|
//: The name of the build configuration created by default for a generic project.
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ static FilePath shadowBuildDirectory(const FilePath &projectFilePath,
|
|||||||
|
|
||||||
const QString projectName = projectFilePath.parentDir().fileName();
|
const QString projectName = projectFilePath.parentDir().fileName();
|
||||||
return MesonBuildConfiguration::buildDirectoryFromTemplate(
|
return MesonBuildConfiguration::buildDirectoryFromTemplate(
|
||||||
Project::projectDirectory(projectFilePath), projectFilePath,
|
projectFilePath.absolutePath(), projectFilePath,
|
||||||
projectName, k, bcName, buildType, "meson");
|
projectName, k, bcName, buildType, "meson");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -793,20 +793,7 @@ void Project::toMap(Store &map) const
|
|||||||
|
|
||||||
FilePath Project::projectDirectory() const
|
FilePath Project::projectDirectory() const
|
||||||
{
|
{
|
||||||
return projectDirectory(projectFilePath());
|
return projectFilePath().absolutePath();
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Returns the directory that contains the file \a top.
|
|
||||||
|
|
||||||
This includes the absolute path.
|
|
||||||
*/
|
|
||||||
|
|
||||||
FilePath Project::projectDirectory(const FilePath &top)
|
|
||||||
{
|
|
||||||
if (top.isEmpty())
|
|
||||||
return {};
|
|
||||||
return top.absolutePath();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Project::changeRootProjectDirectory()
|
void Project::changeRootProjectDirectory()
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ public:
|
|||||||
|
|
||||||
Utils::FilePath projectFilePath() const;
|
Utils::FilePath projectFilePath() const;
|
||||||
Utils::FilePath projectDirectory() const;
|
Utils::FilePath projectDirectory() const;
|
||||||
static Utils::FilePath projectDirectory(const Utils::FilePath &top);
|
|
||||||
|
|
||||||
// This does not affect nodes, only the root path.
|
// This does not affect nodes, only the root path.
|
||||||
void changeRootProjectDirectory();
|
void changeRootProjectDirectory();
|
||||||
|
|||||||
@@ -44,8 +44,7 @@ static FilePath defaultBuildDirectory(const FilePath &projectFilePath, const Kit
|
|||||||
{
|
{
|
||||||
const QString projectName = projectFilePath.completeBaseName();
|
const QString projectName = projectFilePath.completeBaseName();
|
||||||
return BuildConfiguration::buildDirectoryFromTemplate(
|
return BuildConfiguration::buildDirectoryFromTemplate(
|
||||||
Project::projectDirectory(projectFilePath),
|
projectFilePath.absolutePath(), projectFilePath, projectName, k, bcName, buildType, "qbs");
|
||||||
projectFilePath, projectName, k, bcName, buildType, "qbs");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -74,8 +74,13 @@ static FilePath buildDir(const FilePath &projectFilePath, const Kit *k)
|
|||||||
{
|
{
|
||||||
const QString projectName = projectFilePath.completeBaseName();
|
const QString projectName = projectFilePath.completeBaseName();
|
||||||
return BuildConfiguration::buildDirectoryFromTemplate(
|
return BuildConfiguration::buildDirectoryFromTemplate(
|
||||||
Project::projectDirectory(projectFilePath),
|
projectFilePath.absolutePath(),
|
||||||
projectFilePath, projectName, k, QString(), BuildConfiguration::Unknown, "qbs");
|
projectFilePath,
|
||||||
|
projectName,
|
||||||
|
k,
|
||||||
|
QString(),
|
||||||
|
BuildConfiguration::Unknown,
|
||||||
|
"qbs");
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool hasBuildGraph(const FilePath &dir)
|
static bool hasBuildGraph(const FilePath &dir)
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ FilePath QmakeBuildConfiguration::shadowBuildDirectory(const FilePath &proFilePa
|
|||||||
return {};
|
return {};
|
||||||
|
|
||||||
const QString projectName = proFilePath.completeBaseName();
|
const QString projectName = proFilePath.completeBaseName();
|
||||||
return buildDirectoryFromTemplate(Project::projectDirectory(proFilePath), proFilePath,
|
return buildDirectoryFromTemplate(proFilePath.absolutePath(), proFilePath,
|
||||||
projectName, k, suffix, buildType, "qmake");
|
projectName, k, suffix, buildType, "qmake");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user