forked from qt-creator/qt-creator
Docker: Use new FilePath API directly
No need to take the QUrl detour. Change-Id: Ia8245f671411f58729834777413b4749f14b128e Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -588,22 +588,21 @@ DeviceEnvironmentFetcher::Ptr DockerDevice::environmentFetcher() const
|
||||
|
||||
FilePath DockerDevice::mapToGlobalPath(const FilePath &pathOnDevice) const
|
||||
{
|
||||
QUrl url = pathOnDevice.toUrl();
|
||||
if (url.isValid()) {
|
||||
QTC_CHECK(url.host() == d->m_data.imageId);
|
||||
QTC_CHECK(url.scheme() == "docker");
|
||||
if (pathOnDevice.needsDevice()) {
|
||||
// Already correct form, only sanity check it's ours...
|
||||
QTC_CHECK(handlesFile(pathOnDevice));
|
||||
return pathOnDevice;
|
||||
}
|
||||
url.setScheme("docker");
|
||||
url.setHost(d->m_data.imageId);
|
||||
url.setPath(pathOnDevice.toString());
|
||||
return FilePath::fromUrl(url);
|
||||
FilePath result;
|
||||
result.setScheme("docker");
|
||||
result.setHost(d->m_data.imageId);
|
||||
result.setPath(pathOnDevice.path());
|
||||
return result;
|
||||
}
|
||||
|
||||
bool DockerDevice::handlesFile(const FilePath &filePath) const
|
||||
{
|
||||
const QUrl &url = filePath.toUrl();
|
||||
return url.scheme() == "docker" && url.host() == d->m_data.imageId;
|
||||
return filePath.scheme() == "docker" && filePath.host() == d->m_data.imageId;
|
||||
}
|
||||
|
||||
bool DockerDevice::isExecutableFile(const FilePath &filePath) const
|
||||
|
Reference in New Issue
Block a user