forked from qt-creator/qt-creator
Docker: combine escapeMountPath function
Change-Id: Ib04f8245d2da096a9d9fdbdf9b5243ca80d52bfa Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -520,18 +520,21 @@ QString escapeMountPathWin(const FilePath &fp)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString escapeMountPath(const FilePath &fp)
|
||||||
|
{
|
||||||
|
if (HostOsInfo::isWindowsHost())
|
||||||
|
return escapeMountPathWin(fp);
|
||||||
|
|
||||||
|
return escapeMountPathUnix(fp);
|
||||||
|
}
|
||||||
|
|
||||||
QStringList toMountArg(const DockerDevicePrivate::TemporaryMountInfo &mi)
|
QStringList toMountArg(const DockerDevicePrivate::TemporaryMountInfo &mi)
|
||||||
{
|
{
|
||||||
QString escapedPath;
|
QString escapedPath;
|
||||||
QString escapedContainerPath;
|
QString escapedContainerPath;
|
||||||
|
|
||||||
if (HostOsInfo::isWindowsHost()) {
|
escapedPath = escapeMountPath(mi.path);
|
||||||
escapedPath = escapeMountPathWin(mi.path);
|
escapedContainerPath = escapeMountPath(mi.containerPath);
|
||||||
escapedContainerPath = escapeMountPathWin(mi.containerPath);
|
|
||||||
} else {
|
|
||||||
escapedPath = escapeMountPathUnix(mi.path);
|
|
||||||
escapedContainerPath = escapeMountPathUnix(mi.containerPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString mountArg = QString(R"(type=bind,"source=%1","destination=%2")")
|
const QString mountArg = QString(R"(type=bind,"source=%1","destination=%2")")
|
||||||
.arg(escapedPath)
|
.arg(escapedPath)
|
||||||
|
|||||||
Reference in New Issue
Block a user