From bf4f6fa230e0fad691dfcad603ed9a9a8309d3f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Wed, 16 Sep 2020 14:33:41 +0200 Subject: [PATCH] QFile: for filesystem::path, use iterators Change-Id: I06477d48191e5c02ebf362ee31d8db5b1f76247a Reviewed-by: Volker Hilsheimer --- src/corelib/io/qfile.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/corelib/io/qfile.h b/src/corelib/io/qfile.h index 882adca715..057e9e12e8 100644 --- a/src/corelib/io/qfile.h +++ b/src/corelib/io/qfile.h @@ -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(path.cbegin()), + reinterpret_cast(path.cend())); } // Both std::filesystem::path and QString (without QT_NO_CAST_FROM_ASCII) can be implicitly