Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#242 closed defect (fixed)

Filter out ".." for root directories

Reported by: Dmitry A. Kuminov Owned by:
Priority: major Milestone: Qt 4.7
Component: General Version: 4.6.3
Severity: low Keywords:
Cc:

Description

http://svn.netlabs.org/qt4/ticket/205#comment:27:

Not sure, if I should open a ticket for that but it's something we already discussed. Some (but not all (!)) file systems on OS/2 report a (hidden) ".." entry in root directories. In case of Creator this allows the user to change up to the drive list. On Windows this is not possible and I'm not 100% sure that this scenario is correctly handled by Creator. In order to achieve consistent behavior, I modified foldernavigationwidget.cpp to not allow changing to "My computer". However, I still think we should filter out ".." for root directories in the lower level file system code...

Change History (5)

comment:1 by rudi, 13 years ago

We really should do this. It is bad to have inconsistent (i.e. file system dependent) behavior. ISTR, that it was actually a bug in HPFS that caused "." and ".." to be present in the root and that is was IBM's quick fix to simply set their attribute to hidden. Most likely the JFS developers copied this for compatibility reasons. Here is an excerpt from Microsoft's FAT document:

Unlike other directories, the root directory itself on any FAT type does 
not have any date or time stamps, does not have a file name (other than 
the implied file name "\"), and does not contain "." and ".." files as 
the first two directory entries in the directory.

NTFS behaves the same...

comment:2 by Dmitry A. Kuminov, 13 years ago

I'm really having the deja vu effect right now. We have already discussed that, you cited that part of MS docs, and I agreed that it needs to be fixed.

Last edited 13 years ago by Dmitry A. Kuminov (previous) (diff)

comment:3 by Dmitry A. Kuminov, 13 years ago

I must say that the behavior you describe (no . and .. in the root directory listing of QDir) is only present on Windows. Not on Linux. There is even a special filter to filter that out (QDir::NoDotAndDotDot). So it's actually Windows here who behaves inconsistently...

Version 0, edited 13 years ago by Dmitry A. Kuminov (next)

comment:4 by Dmitry A. Kuminov, 13 years ago

Resolution: fixed
Status: newclosed

We indeed want consistency on OS/2 across different IFSes so I filter dots out in in r1047. This makes us behave like Windows (since the OS/2-specific behavior in Qt is often similar to Windows, this makes some sense too).

Qt Creator behaves as expected now.

comment:5 by Dmitry A. Kuminov, 13 years ago

Milestone: Qt 4.nextQt 4.7
Note: See TracTickets for help on using tickets.