Utils: Introduce FilePath::mapTo{Device,Global}Path

Re-directing via IDevice::mapTo{Device,Global}Path

Change-Id: Ica957839479967790bbd93e90eced66aa0b122a8
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2021-10-08 10:31:30 +02:00
parent f49fbe7f58
commit 34b42a4772
8 changed files with 53 additions and 0 deletions

View File

@@ -819,6 +819,24 @@ FilePath FilePath::symLinkTarget() const
return FilePath::fromString(info.symLinkTarget());
}
FilePath FilePath::mapToGlobalPath() const
{
if (needsDevice()) {
QTC_ASSERT(s_deviceHooks.mapToGlobalPath, return {});
return s_deviceHooks.mapToGlobalPath(*this);
}
return *this;
}
QString FilePath::mapToDevicePath() const
{
if (needsDevice()) {
QTC_ASSERT(s_deviceHooks.mapToDevicePath, return {});
return s_deviceHooks.mapToDevicePath(*this);
}
return m_data;
}
FilePath FilePath::withExecutableSuffix() const
{
FilePath res = *this;