From 58f984d2b9d361e20b04e82a3fab03ad600687a5 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 17 Jun 2021 16:35:21 +0200 Subject: [PATCH] Qmake: FilePathify remaining qmakeproject.cpp Change-Id: I79860efc69b0053701306a83c61dfc4bc2d31bb3 Reviewed-by: David Schulz --- .../qmakeprojectmanager/qmakeproject.cpp | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index a521d4bcf7a..212748af514 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -1140,30 +1140,30 @@ void QmakeBuildSystem::updateBuildSystemData() const QStringList &config = node->variableValue(Variable::Config); - QString destDir = ti.destDir.toString(); - QString workingDir; + FilePath destDir = ti.destDir; + FilePath workingDir; if (!destDir.isEmpty()) { bool workingDirIsBaseDir = false; - if (destDir == ti.buildTarget) + if (destDir.path() == ti.buildTarget) workingDirIsBaseDir = true; - if (QDir::isRelativePath(destDir)) - destDir = QDir::cleanPath(ti.buildDir.toString() + '/' + destDir); + if (QDir::isRelativePath(destDir.path())) + destDir = ti.buildDir / destDir.path(); if (workingDirIsBaseDir) - workingDir = ti.buildDir.toString(); + workingDir = ti.buildDir; else workingDir = destDir; } else { - workingDir = ti.buildDir.toString(); + workingDir = ti.buildDir; } if (HostOsInfo::isMacHost() && config.contains("app_bundle")) - workingDir += '/' + ti.target + ".app/Contents/MacOS"; + workingDir = workingDir / (ti.target + ".app/Contents/MacOS"); BuildTargetInfo bti; bti.targetFilePath = executableFor(node->proFile()); bti.projectFilePath = node->filePath(); - bti.workingDirectory = FilePath::fromString(workingDir); + bti.workingDirectory = workingDir; bti.displayName = bti.projectFilePath.completeBaseName(); const FilePath relativePathInProject = bti.projectFilePath.relativeChildPath(projectDirectory()); @@ -1189,7 +1189,7 @@ void QmakeBuildSystem::updateBuildSystemData() QmakeProFile *proFile = node->proFile(); QTC_ASSERT(proFile, return); const QString proDirectory = buildDir(proFile->filePath()).toString(); - foreach (QString dir, libDirectories) { + for (QString dir : libDirectories) { // Fix up relative entries like "LIBS+=-L.." const QFileInfo fi(dir); if (!fi.isAbsolute()) @@ -1261,8 +1261,8 @@ static FilePath destDirFor(const TargetInformation &ti) { if (ti.destDir.isEmpty()) return ti.buildDir; - if (QDir::isRelativePath(ti.destDir.toString())) - return FilePath::fromString(QDir::cleanPath(ti.buildDir.toString() + '/' + ti.destDir.toString())); + if (QDir::isRelativePath(ti.destDir.path())) + return ti.buildDir / ti.destDir.path(); return ti.destDir; } @@ -1390,8 +1390,8 @@ void QmakeBuildSystem::testToolChain(ToolChain *tc, const FilePath &path) const // Suppress warnings on Apple machines where compilers in /usr/bin point into Xcode. // This will suppress some valid warnings, but avoids annoying Apple users with // spurious warnings all the time! - if (pair.first.toString().startsWith("/usr/bin/") - && pair.second.toString().contains("/Contents/Developer/Toolchains/")) { + if (pair.first.path().startsWith("/usr/bin/") + && pair.second.path().contains("/Contents/Developer/Toolchains/")) { return; } TaskHub::addTask(