Utils: Sanitize FilePath::onDevice()

It's one entry in the FilePath world, so it should start with a QString.

Change-Id: Ib2693f52d56103a4c37ba7361b191c2a5c2a72f8
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2022-11-16 15:07:25 +01:00
parent 213d60ad64
commit f59ca97a84
5 changed files with 16 additions and 20 deletions

View File

@@ -551,11 +551,6 @@ FilePath FilePath::symLinkTarget() const
return fileAccess()->symLinkTarget(*this);
}
QString FilePath::mapToDevicePath() const
{
return fileAccess()->mapToDevicePath(*this);
}
FilePath FilePath::withExecutableSuffix() const
{
return withNewPath(OsSpecificAspects::withExecutableSuffix(osType(), path()));
@@ -1088,10 +1083,9 @@ FilePath FilePath::onDevice(const FilePath &deviceTemplate) const
return *this;
// TODO: converting paths between different non local devices is still unsupported
QTC_CHECK(!needsDevice());
FilePath res;
res.setParts(deviceTemplate.scheme(), deviceTemplate.host(), path());
res.setPath(res.mapToDevicePath());
return res;
return fromParts(deviceTemplate.scheme(),
deviceTemplate.host(),
deviceTemplate.fileAccess()->mapToDevicePath(path()));
}
/*!