forked from qt-creator/qt-creator
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:
@@ -1069,6 +1069,17 @@ FilePath DockerDevice::mapToGlobalPath(const FilePath &pathOnDevice) const
|
||||
return result;
|
||||
}
|
||||
|
||||
QString DockerDevice::mapToDevicePath(const Utils::FilePath &globalPath) const
|
||||
{
|
||||
const FilePath normalized = globalPath.normalizedPathName();
|
||||
QString path = normalized.path();
|
||||
if (normalized.startsWithDriveLetter()) {
|
||||
const QChar lowerDriveLetter = path.at(0).toLower();
|
||||
path = '/' + lowerDriveLetter + path.mid(2); // strip C:
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
bool DockerDevice::handlesFile(const FilePath &filePath) const
|
||||
{
|
||||
return filePath.scheme() == "docker" && filePath.host() == d->m_data.imageId;
|
||||
|
||||
Reference in New Issue
Block a user