QFile: for filesystem::path, use iterators

Change-Id: I06477d48191e5c02ebf362ee31d8db5b1f76247a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Mårten Nordheim 2020-09-16 14:33:41 +02:00
parent 8c8b9a4173
commit bf4f6fa230

View File

@ -68,11 +68,8 @@ inline QString fromFilesystemPath(const std::filesystem::path &path)
inline std::filesystem::path toFilesystemPath(const QString &path)
{
#ifdef Q_OS_WIN
return std::filesystem::path(path.toStdU16String());
#else
return std::filesystem::path(path.toStdString());
#endif
return std::filesystem::path(reinterpret_cast<const char16_t *>(path.cbegin()),
reinterpret_cast<const char16_t *>(path.cend()));
}
// Both std::filesystem::path and QString (without QT_NO_CAST_FROM_ASCII) can be implicitly