diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 26 | ||||
-rw-r--r-- | source/blender/editors/space_file/fsmenu.c | 75 | ||||
m--------- | source/tools | 0 |
3 files changed, 78 insertions, 23 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; + } } } } diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 5702fe72396..af3ad0c354d 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -617,6 +617,7 @@ void fsmenu_read_bookmarks(struct FSMenu *fsmenu, const char *filename) #ifdef WIN32 /* Add a Windows known folder path to the System list. */ static void fsmenu_add_windows_folder(struct FSMenu *fsmenu, + FSMenuCategory category, REFKNOWNFOLDERID rfid, const char *name, const int icon, @@ -627,7 +628,7 @@ static void fsmenu_add_windows_folder(struct FSMenu *fsmenu, if (SHGetKnownFolderPath(rfid, 0, NULL, &pPath) == S_OK) { BLI_strncpy_wchar_as_utf8(line, pPath, FILE_MAXDIR); CoTaskMemFree(pPath); - fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS, line, name, icon, flag); + fsmenu_insert_entry(fsmenu, category, line, name, icon, flag); } } #endif @@ -690,22 +691,68 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks) /* Get Special Folder Locations. */ if (read_bookmarks) { + + /* These items are shown in System List. */ + fsmenu_add_windows_folder(fsmenu, + FS_CATEGORY_SYSTEM_BOOKMARKS, + &FOLDERID_Profile, + IFACE_("Home"), + ICON_HOME, + FS_INSERT_LAST); + fsmenu_add_windows_folder(fsmenu, + FS_CATEGORY_SYSTEM_BOOKMARKS, + &FOLDERID_Desktop, + IFACE_("Desktop"), + ICON_DESKTOP, + FS_INSERT_LAST); + fsmenu_add_windows_folder(fsmenu, + FS_CATEGORY_SYSTEM_BOOKMARKS, + &FOLDERID_Documents, + IFACE_("Documents"), + ICON_DOCUMENTS, + FS_INSERT_LAST); + fsmenu_add_windows_folder(fsmenu, + FS_CATEGORY_SYSTEM_BOOKMARKS, + &FOLDERID_Downloads, + IFACE_("Downloads"), + ICON_IMPORT, + FS_INSERT_LAST); + fsmenu_add_windows_folder(fsmenu, + FS_CATEGORY_SYSTEM_BOOKMARKS, + &FOLDERID_Music, + IFACE_("Music"), + ICON_FILE_SOUND, + FS_INSERT_LAST); + fsmenu_add_windows_folder(fsmenu, + FS_CATEGORY_SYSTEM_BOOKMARKS, + &FOLDERID_Pictures, + IFACE_("Pictures"), + ICON_FILE_IMAGE, + FS_INSERT_LAST); + fsmenu_add_windows_folder(fsmenu, + FS_CATEGORY_SYSTEM_BOOKMARKS, + &FOLDERID_Videos, + IFACE_("Videos"), + ICON_FILE_MOVIE, + FS_INSERT_LAST); + fsmenu_add_windows_folder(fsmenu, + FS_CATEGORY_SYSTEM_BOOKMARKS, + &FOLDERID_Fonts, + IFACE_("Fonts"), + ICON_FONTPREVIEW, + FS_INSERT_LAST); + + /* These items are just put in path cache for thumbnail views and if bookmarked. */ + fsmenu_add_windows_folder( - fsmenu, &FOLDERID_Profile, IFACE_("Home"), ICON_HOME, FS_INSERT_LAST); - fsmenu_add_windows_folder( - fsmenu, &FOLDERID_Desktop, IFACE_("Desktop"), ICON_DESKTOP, FS_INSERT_LAST); - fsmenu_add_windows_folder( - fsmenu, &FOLDERID_Documents, IFACE_("Documents"), ICON_DOCUMENTS, FS_INSERT_LAST); - fsmenu_add_windows_folder( - fsmenu, &FOLDERID_Downloads, IFACE_("Downloads"), ICON_IMPORT, FS_INSERT_LAST); - fsmenu_add_windows_folder( - fsmenu, &FOLDERID_Music, IFACE_("Music"), ICON_FILE_SOUND, FS_INSERT_LAST); - fsmenu_add_windows_folder( - fsmenu, &FOLDERID_Pictures, IFACE_("Pictures"), ICON_FILE_IMAGE, FS_INSERT_LAST); + fsmenu, FS_CATEGORY_OTHER, &FOLDERID_UserProfiles, NULL, ICON_COMMUNITY, FS_INSERT_LAST); + fsmenu_add_windows_folder( - fsmenu, &FOLDERID_Videos, IFACE_("Videos"), ICON_FILE_MOVIE, FS_INSERT_LAST); + fsmenu, FS_CATEGORY_OTHER, &FOLDERID_Objects3D, NULL, ICON_FILE_3D, FS_INSERT_LAST); + fsmenu_add_windows_folder( - fsmenu, &FOLDERID_Fonts, IFACE_("Fonts"), ICON_FONTPREVIEW, FS_INSERT_LAST); + fsmenu, FS_CATEGORY_OTHER, &FOLDERID_SkyDrive, NULL, ICON_URL, FS_INSERT_LAST); + } } #else diff --git a/source/tools b/source/tools -Subproject d230f2161f36f8b21f3ce8eeb19b34c0629506c +Subproject 4a6f1706258439db3ee5a50ec6938fef79c7cb9 |