Use toStdU16String when converting string to std::filesystem::path

qUtf16Printable causes a crash in linux.

Pick-to: 6.8.0 6.7
Fixes: QTBUG-129375
Change-Id: Icb0aed74e0a2af762aee464d52a63e0f847b85a9
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
(cherry picked from commit a599838f7a23df53d6d5f5f252ba820762f239af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Antti Määttä 2024-09-27 11:48:10 +03:00 committed by Qt Cherry-pick Bot
parent 1215f61a1f
commit cf92f38bb1

View File

@ -186,7 +186,7 @@ QCtfLibImpl::QCtfLibImpl()
void QCtfLibImpl::clearLocation()
{
#if QT_CONFIG(cxx17_filesystem)
const std::filesystem::path location{qUtf16Printable(m_location)};
const std::filesystem::path location{m_location.toStdU16String()};
for (auto const& dirEntry : std::filesystem::directory_iterator{location})
{
const auto path = dirEntry.path();