mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-08 06:00:59 -07:00
Improve absolute/relative path detection
This commit is contained in:
parent
43df7d0cd4
commit
2fa5ad982d
1 changed files with 6 additions and 0 deletions
|
@ -95,11 +95,17 @@ bool Path::isEmpty() const
|
||||||
|
|
||||||
bool Path::isAbsolute() 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);
|
return QDir::isAbsolutePath(m_pathStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Path::isRelative() const
|
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);
|
return QDir::isRelativePath(m_pathStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue