Remove a few now-unnecessary cleanPath in conjunction with resolvePath

Change-Id: I05ee0116183a30e907fbd8e0b4faae9e6e58723d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2022-11-30 13:41:49 +01:00
parent 76804a0839
commit 7e9d50a2c9
5 changed files with 8 additions and 10 deletions

View File

@@ -1559,8 +1559,7 @@ FilePath FilePath::resolvePath(const FilePath &tail) const
*/
FilePath FilePath::resolvePath(const QString &tail) const
{
FilePath tailPath = FilePath::fromString(doCleanPath(tail));
return resolvePath(tailPath);
return resolvePath(FilePath::fromString(tail));
}
// Cleans path part similar to QDir::cleanPath()

View File

@@ -306,8 +306,7 @@ FilePaths CMakeBuildSystem::filesGeneratedFrom(const FilePath &sourceFile) const
if (sourceFile.suffix() == "ui") {
generatedFilePath = generatedFilePath
.pathAppended("ui_" + sourceFile.completeBaseName() + ".h")
.cleanPath();
.pathAppended("ui_" + sourceFile.completeBaseName() + ".h");
return {generatedFilePath};
}
if (sourceFile.suffix() == "scxml") {

View File

@@ -464,7 +464,7 @@ FilePath directorySourceDir(const Configuration &c, const FilePath &sourceDir, i
const size_t di = static_cast<size_t>(directoryIndex);
QTC_ASSERT(di < c.directories.size(), return FilePath());
return sourceDir.resolvePath(c.directories[di].sourcePath).cleanPath();
return sourceDir.resolvePath(c.directories[di].sourcePath);
}
FilePath directoryBuildDir(const Configuration &c, const FilePath &buildDir, int directoryIndex)
@@ -472,7 +472,7 @@ FilePath directoryBuildDir(const Configuration &c, const FilePath &buildDir, int
const size_t di = static_cast<size_t>(directoryIndex);
QTC_ASSERT(di < c.directories.size(), return FilePath());
return buildDir.resolvePath(c.directories[di].buildPath).cleanPath();
return buildDir.resolvePath(c.directories[di].buildPath);
}
void addProjects(const QHash<Utils::FilePath, ProjectNode *> &cmakeListsNodes,
@@ -542,7 +542,7 @@ void addCompileGroups(ProjectNode *targetRoot,
std::vector<std::vector<std::unique_ptr<FileNode>>> sourceGroupFileNodes{td.sourceGroups.size()};
for (const SourceInfo &si : td.sources) {
const FilePath sourcePath = topSourceDirectory.resolvePath(si.path).cleanPath();
const FilePath sourcePath = topSourceDirectory.resolvePath(si.path);
// Filter out already known files:
const int count = alreadyListed.count();

View File

@@ -919,9 +919,9 @@ FilePath FileApiParser::scanForCMakeReplyFile(const FilePath &buildDirectory)
FilePaths FileApiParser::cmakeQueryFilePaths(const FilePath &buildDirectory)
{
FilePath queryDir = buildDirectory / CMAKE_RELATIVE_QUERY_PATH;
const FilePath queryDir = buildDirectory / CMAKE_RELATIVE_QUERY_PATH;
return transform(CMAKE_QUERY_FILENAMES, [&queryDir](const QString &name) {
return queryDir.resolvePath(FilePath::fromString(name));
return queryDir.resolvePath(name);
});
}

View File

@@ -252,7 +252,7 @@ MakeFileParse::MakeFileParse(const FilePath &makefile, Mode mode) : m_mode(mode)
project = project.trimmed();
// Src Pro file
m_srcProFile = makefile.parentDir().resolvePath(project).cleanPath();
m_srcProFile = makefile.parentDir().resolvePath(project);
qCDebug(logging()) << " source .pro file:" << m_srcProFile;
QString command = findQMakeLine(makefile, QLatin1String("# Command:")).trimmed();