forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user