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;
|
||||
}
|
||||
|
||||
QString escapeMountPath(const FilePath &fp)
|
||||
{
|
||||
if (HostOsInfo::isWindowsHost())
|
||||
return escapeMountPathWin(fp);
|
||||
|
||||
return escapeMountPathUnix(fp);
|
||||
}
|
||||
|
||||
QStringList toMountArg(const DockerDevicePrivate::TemporaryMountInfo &mi)
|
||||
{
|
||||
QString escapedPath;
|
||||
QString escapedContainerPath;
|
||||
|
||||
if (HostOsInfo::isWindowsHost()) {
|
||||
escapedPath = escapeMountPathWin(mi.path);
|
||||
escapedContainerPath = escapeMountPathWin(mi.containerPath);
|
||||
} else {
|
||||
escapedPath = escapeMountPathUnix(mi.path);
|
||||
escapedContainerPath = escapeMountPathUnix(mi.containerPath);
|
||||
}
|
||||
escapedPath = escapeMountPath(mi.path);
|
||||
escapedContainerPath = escapeMountPath(mi.containerPath);
|
||||
|
||||
const QString mountArg = QString(R"(type=bind,"source=%1","destination=%2")")
|
||||
.arg(escapedPath)
|
||||
|
||||
Reference in New Issue
Block a user