Browse Source

Correctly detect drive letter in path

PR #18258.
Closes #18224.
adaptive-webui-19844
Vladimir Golovnev 2 years ago committed by GitHub
parent
commit
b12fdcf018
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/base/path.cpp

2
src/base/path.cpp

@ -142,7 +142,7 @@ Path Path::rootItem() const
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
// should be `c:/` instead of `c:` // should be `c:/` instead of `c:`
if (m_pathStr.at(slashIndex - 1) == u':') if ((slashIndex == 2) && hasDriveLetter(m_pathStr))
return createUnchecked(m_pathStr.left(slashIndex + 1)); return createUnchecked(m_pathStr.left(slashIndex + 1));
#endif #endif
return createUnchecked(m_pathStr.left(slashIndex)); return createUnchecked(m_pathStr.left(slashIndex));

Loading…
Cancel
Save