diff options
author | hjk <hjk@qt.io> | 2021-10-08 11:50:07 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2021-10-12 11:24:38 +0000 |
commit | d75005fbd2271974a048f4b496379779de43d8ba (patch) | |
tree | c4b5b8affb2050946de0d44980c89932f1e4408e | |
parent | 34b42a477229bd2e57137909fcf9724f56c20068 (diff) |
Docker: Use mapToDevicePath() in startContainer()
Change-Id: Iad91144413a176bee036e03192713f5bf4695dcb
Reviewed-by: David Schulz <david.schulz@qt.io>
-rw-r--r-- | src/plugins/docker/dockerdevice.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 377b777d40..65e3598e60 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -833,14 +833,7 @@ void DockerDevicePrivate::startContainer() for (QString mount : qAsConst(m_data.mounts)) { if (mount.isEmpty()) continue; - // make sure to convert windows style paths to unix style paths with the file system case: - // C:/dev/src -> /c/dev/src - if (const FilePath mountPath = FilePath::fromUserInput(mount).normalizedPathName(); - mountPath.startsWithDriveLetter()) { - const QChar lowerDriveLetter = mountPath.path().at(0).toLower(); - const FilePath path = FilePath::fromUserInput(mountPath.path().mid(2)); // strip C: - mount = '/' + lowerDriveLetter + path.path(); - } + mount = q->mapToDevicePath(FilePath::fromUserInput(mount)); dockerCreate.addArgs({"-v", mount + ':' + mount}); } @@ -1071,6 +1064,8 @@ FilePath DockerDevice::mapToGlobalPath(const FilePath &pathOnDevice) const QString DockerDevice::mapToDevicePath(const Utils::FilePath &globalPath) const { + // make sure to convert windows style paths to unix style paths with the file system case: + // C:/dev/src -> /c/dev/src const FilePath normalized = globalPath.normalizedPathName(); QString path = normalized.path(); if (normalized.startsWithDriveLetter()) { |