From 5abd72d42ad1f2693b95ebf33c5a9423a8927d0b Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 28 Jul 2022 16:18:46 +0800 Subject: [PATCH] Add comments about "UNC path" support --- src/base/path.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/base/path.cpp b/src/base/path.cpp index 21437b19d..6053e8f53 100644 --- a/src/base/path.cpp +++ b/src/base/path.cpp @@ -73,6 +73,8 @@ Path::Path(const std::string &pathStr) bool Path::isValid() const { + // does not support UNC path + if (isEmpty()) return false; @@ -116,6 +118,8 @@ bool Path::exists() const Path Path::rootItem() const { + // does not support UNC path + const int slashIndex = m_pathStr.indexOf(u'/'); if (slashIndex < 0) return *this; @@ -133,6 +137,8 @@ Path Path::rootItem() const Path Path::parentPath() const { + // does not support UNC path + const int slashIndex = m_pathStr.lastIndexOf(u'/'); if (slashIndex == -1) return {};