-
Type:
Bug
-
Status: Closed
-
Priority:
Not Evaluated
-
Resolution: Invalid
-
Affects Version/s: 5.11.1
-
Fix Version/s: None
-
Component/s: Core: I/O
-
Labels:None
Using QDir:::cleanPath on Windows file names does not results in expected path according to documention, e.g
qDebug() << QString("C:/foo/bar: %0").arg(QDir::cleanPath("C:/foo/bar")); qDebug() << QString("C:\foo\bar: %0").arg(QDir::cleanPath("C:\foo\bar")); qDebug() << QString("C:\\foo\\bar: %0").arg(QDir::cleanPath("C:\\foo\\bar"));
shows this output on linux machine
"C:/foo/bar: C:/foo/bar" "C:\foo\bar: C:\foo\bar" "C:\\foo\\bar: C:\\foo\\bar"
...and this output on windows machine
"C:/foo/bar: C:/foo/bar" "C:\foo\bar: C:\foo\bar" "C:\\foo\\bar: C:/foo/bar"
In the documentation QDir::cleanPath is explained like this:
Returns path with directory separators normalized (converted to "/") and redundant ones removed, and "."s and ".."s resolved (as far as possible).
This is obviously not true and confusing.