Browse Source

Improve absolute/relative path detection

adaptive-webui-19844
Chocobo1 2 years ago
parent
commit
2fa5ad982d
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 6
      src/base/path.cpp

6
src/base/path.cpp

@ -95,11 +95,17 @@ bool Path::isEmpty() const @@ -95,11 +95,17 @@ bool Path::isEmpty() const
bool Path::isAbsolute() const
{
// `QDir::isAbsolutePath` treats `:` as a path to QResource, so handle it manually
if (m_pathStr.startsWith(u':'))
return false;
return QDir::isAbsolutePath(m_pathStr);
}
bool Path::isRelative() const
{
// `QDir::isRelativePath` treats `:` as a path to QResource, so handle it manually
if (m_pathStr.startsWith(u':'))
return true;
return QDir::isRelativePath(m_pathStr);
}

Loading…
Cancel
Save