Simplify implementation

This also enable each platform to provide its own optimal implementation of it.
This commit is contained in:
Chocobo1 2022-07-22 18:36:52 +08:00
parent 5b269a782a
commit 727d20cc92
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
3 changed files with 16 additions and 12 deletions

View file

@ -218,6 +218,15 @@ QString Path::toString() const
return QDir::toNativeSeparators(m_pathStr);
}
std::filesystem::path Path::toStdFsPath() const
{
#ifdef Q_OS_WIN
return {data().toStdWString(), std::filesystem::path::format::generic_format};
#else
return {data().toStdString(), std::filesystem::path::format::generic_format};
#endif
}
Path &Path::operator/=(const Path &other)
{
*this = *this / other;