Page MenuHome

UI: File Browser Favorites
ClosedPublic

Authored by Harley Acheson (harley) on Mar 3 2020, 10:46 PM.

Details

Summary

This patch just adds some more special folder locations to the File Browser, but ones that are not quite important enough to be shown in the System list. In a nutshell there are small number of folders that I would like to mark specially only if they are added to Favorites, are on the Recent list, or if you are just browsing in thumbnail view.

For this there is a new list added, FS_INTERNAL_PATH_CACHE, that can contain paths used for this purpose. And this cache is looked in when adding other entries or when browsing.

For all platforms the special folders added are for U.fontdir, U.textudir, U.pythondir, U.sounddir, U.tempdir.

For Windows this includes the root of all profiles, the new "3D Objects" profile folder, and Microsoft OneDrive.

Part of the reason for this patch is that the "Mac System List" patch requires this path cache idea and therefore this patch will bring that one down to a trivial 20 lines or so. And I am really wanting to get that one in for 2.83 so that we have feature parity between platforms.

Diff Detail

Repository
rB Blender

Event Timeline

Brecht Van Lommel (brecht) requested changes to this revision.Mar 4 2020, 9:45 AM
Brecht Van Lommel (brecht) added inline comments.
source/blender/editors/include/ED_fileselect.h
175

Use the same prefix for the entire enum. This also does not seem to be a "cache" in typical programming terminology.

Maybe FS_CATEGORY_OTHER would be better.

source/blender/editors/space_file/filelist.c
1002

Don't abbreviate variable names unnecessarily.

1006–1007

Just structure this as a regular for loop, no need for confusing reverse iteration.

for (int i = 0; i < ARRAY_SIZE(categories); i++)
source/blender/editors/space_file/fsmenu.c
983–984

Always use {}

This revision now requires changes to proceed.Mar 4 2020, 9:45 AM

Updated to incorporate changes requested by @Brecht Van Lommel (brecht)

  • Changes to comments
  • Changes to menu category identifier
  • Remove unnecessary abbreviation
  • Simplified Loop
  • Added braces to define

This and @Yevgeny Makarov (jenkm) 's patch for Mac File Browser System List are nicely aligned now. So ideally (once approved) I would be just be committing his (with him as author) when he and I are both around. Then add any differences here afterward.

This comment was removed by Harley Acheson (harley).
This revision is now accepted and ready to land.Mar 5 2020, 6:54 PM

Updated to reflect current state of master - mostly removals because of prior commit of Mac System List changes

This revision was automatically updated to reflect the committed changes.