Utils: Introduce FilePath::operator/(const QString &)

Including some random uses.

This mimics  std::filesystem::operator/(std::filesystem::path).

Change-Id: I0b0f5cf0d962fd33d4cbb9be96645a0b4a21ee03
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2020-02-19 17:35:56 +01:00
parent e3abd5b348
commit 021cab2048
10 changed files with 44 additions and 45 deletions

View File

@@ -427,8 +427,8 @@ void BuildDirManager::clearCache()
QTC_ASSERT(m_parameters.isValid(), return);
QTC_ASSERT(!m_isHandlingError, return);
const FilePath cmakeCache = m_parameters.workDirectory.pathAppended("CMakeCache.txt");
const FilePath cmakeFiles = m_parameters.workDirectory.pathAppended("CMakeFiles");
const FilePath cmakeCache = m_parameters.workDirectory / "CMakeCache.txt";
const FilePath cmakeFiles = m_parameters.workDirectory / "CMakeFiles";
const bool mustCleanUp = cmakeCache.exists() || cmakeFiles.exists();
if (!mustCleanUp)

View File

@@ -241,9 +241,7 @@ void CMakeManager::buildFile(Node *node)
if (generator == "Ninja") {
const Utils::FilePath relativeBuildDir = targetNode->buildDirectory().relativeChildPath(
bc->buildDirectory());
targetBase = relativeBuildDir
.pathAppended("CMakeFiles")
.pathAppended(targetNode->displayName() + ".dir");
targetBase = relativeBuildDir / "CMakeFiles" / (targetNode->displayName() + ".dir");
} else if (!generator.contains("Makefiles")) {
Core::MessageManager::write(tr("Build File is not supported for generator \"%1\"")
.arg(generator));