Details
-
Bug
-
Resolution: Invalid
-
P3: Somewhat important
-
4.7.0
-
None
Description
Currently QFileSystemModel assumes all paths are properly capitalized as they are in the file system. If incorrectly capitalized path is given, duplicate nodes will result in QFileSystemModel, because it uses path element strings as hash keys. This can be easily demonstrated e.g. by giving "C:/data" as initial directory to QFileDialog, which also automatically adds the home dir "C:/Data" to its model. As a result, C:-root will display both "data" and "Data" directories.
Path resolving in QFileSystemModel needs to be handled similarly to windows (see qt_GetLongPathName in qfilesystemmodel.cpp). This means it is probably also necessary to fix file engine so that requesting absolute path gives properly capitalized path.
Achieving this via RFs can be tricky. One potential option is RFs::LongPath, which seems to resolve proper capitalization for single path element. CDirScan or RFs::GetDir might be another possibility to get properly capitalized names. None of these seems very efficient approach, though.