mirror of
https://github.com/OpenMW/openmw.git
synced 2025-10-22 14:56:36 +00:00
Cleverer filesystem path conversion for QString/QStringView
This commit is contained in:
parent
0bae2b14b1
commit
b7ddc8304b
1 changed files with 2 additions and 4 deletions
|
@ -18,12 +18,10 @@ QString Files::pathToQString(std::filesystem::path&& path)
|
|||
|
||||
std::filesystem::path Files::pathFromQString(QStringView path)
|
||||
{
|
||||
const QByteArray tmp = path.toUtf8();
|
||||
return std::filesystem::path(Misc::StringUtils::stringToU8String(std::string_view(tmp.constData(), tmp.size())));
|
||||
return std::filesystem::path(std::u16string_view(path.utf16(), path.size()));
|
||||
}
|
||||
|
||||
std::filesystem::path Files::pathFromQString(QString&& path)
|
||||
{
|
||||
const QByteArray tmp = path.toUtf8();
|
||||
return std::filesystem::path(Misc::StringUtils::stringToU8String(std::string_view(tmp.constData(), tmp.size())));
|
||||
return std::filesystem::path(path.toStdU16String());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue