Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarley Acheson <harley.acheson@gmail.com>2020-03-05 22:49:56 +0300
committerHarley Acheson <harley.acheson@gmail.com>2020-03-05 22:49:56 +0300
commite56471bcd3a5f0a9bdc369cc4ca9ceb061e321dd (patch)
tree689adef58a885dae6e4a169dd488a9c8cf34cd18 /source/blender/editors/space_file/filelist.c
parent84c9a99cca903ea02435353f41c1c88525e3f91c (diff)
UI: File Browser Favorites
Adding more Windows special folder locations, used when browsing or bookmarking. Differential Revision: https://developer.blender.org/D7014 Reviewed by Brecht Van Lommel
Diffstat (limited to 'source/blender/editors/space_file/filelist.c')
-rw-r--r--source/blender/editors/space_file/filelist.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 11304d6ae46..948fa91718e 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -996,16 +996,24 @@ static int filelist_geticon_ex(FileDirEntry *file,
return (file->attributes & FILE_ATTR_ANY_LINK) ? ICON_FOLDER_REDIRECT : ICON_FILE_FOLDER;
}
else {
- /* If this path is in System list then use that icon. */
+
+ /* If this path is in System list or path cache then use that icon. */
struct FSMenu *fsmenu = ED_fsmenu_get();
- FSMenuEntry *tfsm = ED_fsmenu_get_category(fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS);
- char fullpath[FILE_MAX_LIBEXTRA];
- BLI_join_dirfile(fullpath, sizeof(fullpath), root, file->relpath);
- BLI_add_slash(fullpath);
- for (; tfsm; tfsm = tfsm->next) {
- if (STREQ(tfsm->path, fullpath)) {
- /* Never want a little folder inside a large one. */
- return (tfsm->icon == ICON_FILE_FOLDER) ? ICON_NONE : tfsm->icon;
+ FSMenuCategory categories[] = {
+ FS_CATEGORY_SYSTEM_BOOKMARKS,
+ FS_CATEGORY_OTHER,
+ };
+
+ for (int i = 0; i < ARRAY_SIZE(categories); i++) {
+ FSMenuEntry *tfsm = ED_fsmenu_get_category(fsmenu, categories[i]);
+ char fullpath[FILE_MAX_LIBEXTRA];
+ BLI_join_dirfile(fullpath, sizeof(fullpath), root, file->relpath);
+ BLI_add_slash(fullpath);
+ for (; tfsm; tfsm = tfsm->next) {
+ if (STREQ(tfsm->path, fullpath)) {
+ /* Never want a little folder inside a large one. */
+ return (tfsm->icon == ICON_FILE_FOLDER) ? ICON_NONE : tfsm->icon;
+ }
}
}
}