Opened 8 years ago

Closed 8 years ago

Last modified 4 years ago

#238 closed defect (fixed)

QFileSystemModel incorrectly sorts directories

Reported by: rudi Owned by:
Priority: major Milestone: Qt 5
Component: QtGui Version:
Severity: low Keywords:
Cc:

Description

QFileSystemModel doesn't make sure, that the "." and ".." entries are reported first. So directories starting with an exclamation mark get listed before them.

Attachments (1)

qfilesystemmodel.diff (1.0 KB) - added by rudi 8 years ago.
Modified sorting

Download all attachments as: .zip

Change History (7)

Changed 8 years ago by rudi

Modified sorting

comment:1 Changed 8 years ago by dmik

  • Milestone changed from Qt 4.7 to Qt 4.next

Why/where do you need this? These pseudo directories are supposed to be hidden by the file dialogs anyway.

comment:2 Changed 8 years ago by rudi

They actually show up in Qt Creator's File System View and other apps that use a QFileSystemModel instead of standard file dialogs. Because of it's generic nature it's probably something to be discussed with the Nokia people...

comment:3 Changed 8 years ago by dmik

Yes, right, now I see the problem (in Qt Creator, on OS/2, Windows and Linux). I think you chose the right place to fix it, it's a generic problem indeed.

Discussing such things with Nokia people is good per se (and can be easily done through their IRC channels, e.g. #qt-labs on freenode.net, there is also a channel for Qt Creator). But in this case I don't see any arguments that they could throw against this fix so I think I will just apply it (it will get discussed anyway once we finally request merging).

The fact that the problem doesn't appear in the standard file dialogs is just because (I already mentioned) "." and ".." get filtered out by them. However, other consumers of QFileSystemModel apparently don't do that.

comment:4 Changed 8 years ago by dmik

Done in r1027.

comment:5 Changed 8 years ago by dmik

  • Resolution set to fixed
  • Status changed from new to closed

comment:6 Changed 4 years ago by diver

  • Milestone changed from Qt 4.next to Qt 5

Milestone renamed

Note: See TracTickets for help on using tickets.