The FileTreeComponent class implements "does-not-include-files" filtering only at the root level.
All subsequent child items of the tree are not filtered at all but always include both - files and directories.
To fix this "bug-or-feature" I suggest small changes to the DirectoryContentsList and FileListTreeItem classes:
I suggest fixing an annoying flaw of the DirectoryContentsList class by adding the public function:
/** Returns current file type flags. */ int getFileTypeFlags() const { return fileTypeFlags; }
...and finally we change one line of the FileListTreeItem::itemOpennessChanged function from this:
l->setDirectory (file, true, true);
to this one:
l->setDirectory (file, parentContentsList->getFileTypeFlags() & File::findDirectories, parentContentsList->getFileTypeFlags() & File::findFiles);
Those changes may affect someone's code who count on old behaviour.
Again, I hope this fix makes JUCE library better.
Best regards.