diff options
author | hjk <[email protected]> | 2021-05-19 10:36:34 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2021-05-20 09:20:30 +0000 |
commit | 3b87c1e44ed9b170da4307fa82f15de6b35e53d1 (patch) | |
tree | d93f0907fc03b4a65bbd637dc2e7fe098d1d2c28 /src/libs/utils/fileutils.cpp | |
parent | 356eaf1d3f365c71c8631e023fb72d534fdc9e26 (diff) |
Utils: Make FilePath::relativeChildPath() work with remote paths
Change-Id: Ie8f3c932714afb5c47236165acda703691cc5cab
Reviewed-by: Christian Stenger <[email protected]>
Diffstat (limited to 'src/libs/utils/fileutils.cpp')
-rw-r--r-- | src/libs/utils/fileutils.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libs/utils/fileutils.cpp b/src/libs/utils/fileutils.cpp index 22969d62a0b..92b848f25fb 100644 --- a/src/libs/utils/fileutils.cpp +++ b/src/libs/utils/fileutils.cpp @@ -1095,9 +1095,10 @@ bool FilePath::isDir() const /// That is, this never returns a path starting with "../" FilePath FilePath::relativeChildPath(const FilePath &parent) const { - if (!isChildOf(parent)) - return FilePath(); - return FilePath::fromString(m_data.mid(parent.m_data.size() + 1, -1)); + FilePath res; + if (isChildOf(parent)) + res.m_data = m_data.mid(parent.m_data.size() + 1, -1); + return res; } /// \returns the relativePath of FilePath to given \a anchor. |