Utils: Fix displaying Unix paths on Windows

This function is used by ExecutableAspect, which processes the path with
FilePath::toUserInput first, so backslash is used as a separator on
input.

Change-Id: I1c69db1bc1ad77697093ef7f7b6cb732f3a1756d
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Martin Kampas
2021-05-17 16:11:19 +02:00
committed by hjk
parent 961d0a4da6
commit fc4065bda4

View File

@@ -75,6 +75,13 @@ inline QString pathWithNativeSeparators(OsType osType, const QString &pathName)
std::replace(std::begin(n) + pos, std::end(n), '/', '\\');
return n;
}
} else {
const int pos = pathName.indexOf('\\');
if (pos >= 0) {
QString n = pathName;
std::replace(std::begin(n) + pos, std::end(n), '\\', '/');
return n;
}
}
return pathName;
}