Details
-
Bug
-
Resolution: Invalid
-
P3: Somewhat important
-
None
-
5.8.0
-
None
Description
QDir::rootPath() is returning low cased drive letter while QDir::drives() return list of QFileInfo where path() return upper cased drive.
While the file system is not case sensitive, that's still is problematic because it can make unit testing or path comparison wrong.
Qt Api should not change the given drive letter case, ie, if I give it a lower "c", then I expect Qt api to not change it when using path or absolutePath (or any other file api).
I also expect that root() / rootPath() have same case than their drives() equivalent.
Test case:
foreach (const QFileInfo &fi, QDir::drives()) { qWarning() << fi.path() << QDir::rootPath() << QDir::root().path() << QFileInfo(QSL("c:/")).path() << QFileInfo(QSL("c:/")).absolutePath() ; }
Output:
"C:/" "c:/" "c:/" "c:/" "C:/"
"Z:/" "c:/" "c:/" "c:/" "C:/"