forked from qt-creator/qt-creator
Utils: Make FilePath::relativeChildPath() work with remote paths
Change-Id: Ie8f3c932714afb5c47236165acda703691cc5cab Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -1095,9 +1095,10 @@ bool FilePath::isDir() const
|
|||||||
/// That is, this never returns a path starting with "../"
|
/// That is, this never returns a path starting with "../"
|
||||||
FilePath FilePath::relativeChildPath(const FilePath &parent) const
|
FilePath FilePath::relativeChildPath(const FilePath &parent) const
|
||||||
{
|
{
|
||||||
if (!isChildOf(parent))
|
FilePath res;
|
||||||
return FilePath();
|
if (isChildOf(parent))
|
||||||
return FilePath::fromString(m_data.mid(parent.m_data.size() + 1, -1));
|
res.m_data = m_data.mid(parent.m_data.size() + 1, -1);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \returns the relativePath of FilePath to given \a anchor.
|
/// \returns the relativePath of FilePath to given \a anchor.
|
||||||
|
Reference in New Issue
Block a user