History log of /haiku/src/kits/tracker/VirtualDirectoryEntryList.cpp
Revision Date Author Comments
# 2532a287 23-Nov-2021 Augustin Cavalier <waddlesplash@gmail.com>

Avoid using unions for LongDirEntry.

GCC still assumes that the dirent has no data past the end for some
scenarios here and still mis-optimizes things. Therefore, drop the
usages of unions altogether, and instead use a casted character array.

Additionally, use B_FILE_NAME_LENGTH for the array, not B_PATH_NAME_LENGTH,
and make sure to add 1 for the NULL terminator.


# 8f03af00 18-Nov-2021 Augustin Cavalier <waddlesplash@gmail.com>

Storage: Rework LongDirEntry to be a union.

Our dirent structure is "slim": it has a flexible-length array at the
end which must be allocated to whatever size the consumer wants. However,
we use [1] there and not [0] or [], which meant GCC thought it was not
a flexible-length array, and so it optimized various string accesses
that it assumed must be always false. Among these was BDirectory's
check for "." and "..", and so that resulted in infinite loops.

When changing our dirent structure to a proper FLA instead of [1],
GCC then throws errors on LongDirEntry as it has data "after" the
FLA; which is what we want, but there is no way to tell GCC that.
So now we use a union instead, which is the proper way to statically
allocate a FLA.

This is part of #17389, but the real fix requires changing our dirent
structure, which is coming in a separate commit.


# 09d0d8f9 20-Jun-2014 John Scipione <jscipione@gmail.com>

Tracker: style fixes to VirtualDirectoryEntryList


# 1c29b26e 29-Jun-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Add virtual directory feature to Tracker

Similar to stored queries, files of the virtual directory type behave
like directories -- i.e. they open in a list-mode Tracker window and
show up as an item with submenu in navigation menus. The file itself is
a plain text file in driver settings format. It can have an arbitrary
number of "directory" entries, which specify the paths of (actual)
directories for which the virtual directory provides a merged view. The
view will not show duplicate entries. For non-directory entries the
first one encountered (according to the order the directory paths are
specified in the file) will be shown. A subdirectory entry will again
behave like a virtual directory.

The support in Tracker isn't perfect yet. I'm afraid major refactoring
would be necessary to get it there.

The virtual directory file type uses a differently colored version of
the folder icon. Alternatives welcome.


# 09d0d8f9dc88c79ab8a7a4c9018e48732ba25718 20-Jun-2014 John Scipione <jscipione@gmail.com>

Tracker: style fixes to VirtualDirectoryEntryList


# 1c29b26e7c7eb94ee125315eca5a94265f613420 29-Jun-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Add virtual directory feature to Tracker

Similar to stored queries, files of the virtual directory type behave
like directories -- i.e. they open in a list-mode Tracker window and
show up as an item with submenu in navigation menus. The file itself is
a plain text file in driver settings format. It can have an arbitrary
number of "directory" entries, which specify the paths of (actual)
directories for which the virtual directory provides a merged view. The
view will not show duplicate entries. For non-directory entries the
first one encountered (according to the order the directory paths are
specified in the file) will be shown. A subdirectory entry will again
behave like a virtual directory.

The support in Tracker isn't perfect yet. I'm afraid major refactoring
would be necessary to get it there.

The virtual directory file type uses a differently colored version of
the folder icon. Alternatives welcome.