FileTreeComponent (bug or feature?)

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.

Thanks! I've checked something in (not tested - give it a try!)

Sorry, Julian, but I cannot see any chages in the git repository.

Are you sure you've checked your chages in?

I'm seeing the commit here.



Are you using: git:// 

I had to change whatever git repo I had set up for JUCE a few weeks back as I noticed i was getting no new commits,

Thank you, Valley!

Yes, you were right. I've used a wrong GIT URL.

Yes, Julian!

It works like a charm.

Thank you!