From 93d7821eae085918a59a5a99a37c997825c5869c Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 16 Jun 2021 18:58:01 +0200 Subject: [PATCH] ProjectExplorer: Use real FilePaths for build directories Even though build directories are later usually accessed "locally in the context of a build device" even in true remote" setups it is easier to reason about them if they follow the convention, especially as they are used to derive other paths that might be used to access items in a host context. Change-Id: Ib831bdd1f81981ef96323dcb8d1cd21c31347c19 Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/buildconfiguration.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index c49550f01ea..e92caf62d18 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -240,7 +240,11 @@ FilePath BuildConfiguration::buildDirectory() const { QString path = environment().expandVariables(d->m_buildDirectoryAspect->value().trimmed()); path = QDir::cleanPath(macroExpander()->expand(path)); - return FilePath::fromString(QDir::cleanPath(QDir(target()->project()->projectDirectory().toString()).absoluteFilePath(path))); + + const FilePath projectDir = target()->project()->projectDirectory(); + const FilePath buildDir = projectDir.absoluteFilePath(FilePath::fromString(path)); + + return mapFromBuildDeviceToGlobalPath(buildDir); } FilePath BuildConfiguration::rawBuildDirectory() const @@ -296,8 +300,7 @@ MacroExpander *BuildConfiguration::macroExpander() const bool BuildConfiguration::createBuildDirectory() { - QDir dir; - const auto result = dir.mkpath(buildDirectory().toString()); + const bool result = buildDirectory().ensureWritableDir(); buildDirectoryAspect()->validateInput(); return result; }