Filepath: Add ::isSameDevice

Change-Id: I3990429b59759d5f72ed95e3a0d1723d3bb7bb82
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2022-09-16 10:26:41 +02:00
parent f736c23afc
commit df859d891d
5 changed files with 24 additions and 14 deletions

View File

@@ -614,6 +614,17 @@ bool FilePath::needsDevice() const
return !m_scheme.isEmpty();
}
bool FilePath::isSameDevice(const FilePath &other) const
{
if (needsDevice() != other.needsDevice())
return false;
if (!needsDevice() && !other.needsDevice())
return true;
QTC_ASSERT(s_deviceHooks.isSameDevice, return true);
return s_deviceHooks.isSameDevice(*this, other);
}
/// \returns an empty FilePath if this is not a symbolic linl
FilePath FilePath::symLinkTarget() const
{