Add comments about "UNC path" support

This commit is contained in:
Chocobo1 2022-07-28 16:18:46 +08:00
parent 2fa5ad982d
commit 5abd72d42a
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C

View File

@ -73,6 +73,8 @@ Path::Path(const std::string &pathStr)
bool Path::isValid() const bool Path::isValid() const
{ {
// does not support UNC path
if (isEmpty()) if (isEmpty())
return false; return false;
@ -116,6 +118,8 @@ bool Path::exists() const
Path Path::rootItem() const Path Path::rootItem() const
{ {
// does not support UNC path
const int slashIndex = m_pathStr.indexOf(u'/'); const int slashIndex = m_pathStr.indexOf(u'/');
if (slashIndex < 0) if (slashIndex < 0)
return *this; return *this;
@ -133,6 +137,8 @@ Path Path::rootItem() const
Path Path::parentPath() const Path Path::parentPath() const
{ {
// does not support UNC path
const int slashIndex = m_pathStr.lastIndexOf(u'/'); const int slashIndex = m_pathStr.lastIndexOf(u'/');
if (slashIndex == -1) if (slashIndex == -1)
return {}; return {};