diff options
| author | hjk <hjk@qt.io> | 2025-02-21 15:51:15 +0100 |
|---|---|---|
| committer | hjk <hjk@qt.io> | 2025-03-04 13:55:35 +0000 |
| commit | 5a78abf3977883150d1ae236feb68fb68f46dca4 (patch) | |
| tree | f7334833f726a10646f5d855f4af19797f8a72d9 /src/plugins/python/pythonbuildsystem.cpp | |
| parent | bc86e6bdd9a196db1652ae8245f07d05f178f184 (diff) | |
Utils: Simplify FilePath::relativePathFrom
File system accesses are better avoided at this level, so shift the
responsibility of having a directory as anchor to the caller side.
Change-Id: Ibca6edcdaaf2f6d24dfaa51bcae401909b77f101
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/python/pythonbuildsystem.cpp')
| -rw-r--r-- | src/plugins/python/pythonbuildsystem.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/python/pythonbuildsystem.cpp b/src/plugins/python/pythonbuildsystem.cpp index 42a0f5a31e3..b8dc13c76bd 100644 --- a/src/plugins/python/pythonbuildsystem.cpp +++ b/src/plugins/python/pythonbuildsystem.cpp @@ -166,14 +166,14 @@ void PythonBuildSystem::triggerParsing() const FilePath python = static_cast<PythonBuildConfiguration *>(buildConfiguration())->python(); const FilePath projectFile = projectFilePath(); - const QString displayName = projectFile.relativePathFrom(projectDirectory()).toUserOutput(); + const QString displayName = projectFile.relativePathFromDir(projectDirectory()).toUserOutput(); newRoot->addNestedNode( std::make_unique<PythonFileNode>(projectFile, displayName, FileType::Project)); bool hasQmlFiles = false; for (const FileEntry &entry : std::as_const(m_files)) { - const QString displayName = entry.filePath.relativePathFrom(projectDirectory()).toUserOutput(); + const QString displayName = entry.filePath.relativePathFromDir(projectDirectory()).toUserOutput(); const FileType fileType = getFileType(entry.filePath); hasQmlFiles |= fileType == FileType::QML; @@ -264,7 +264,7 @@ bool PythonBuildSystem::addFiles(Node *, const FilePaths &filePaths, FilePaths * return false; if (existingPaths.contains(filePath)) continue; - m_files.append(FileEntry{filePath.relativePathFrom(projectDir).path(), filePath}); + m_files.append(FileEntry{filePath.relativePathFromDir(projectDir).path(), filePath}); } if (projectFilesWereSorted) |
