diff options
-rw-r--r-- | source/blender/editors/include/ED_fileselect.h | 2 | ||||
-rw-r--r-- | source/blender/editors/space_file/fsmenu.c | 17 | ||||
-rw-r--r-- | source/blender/editors/space_file/fsmenu.h | 2 | ||||
-rw-r--r-- | source/blender/editors/space_file/space_file.c | 28 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 3 | ||||
-rw-r--r-- | source/blenderplayer/bad_level_call_stubs/stubs.c | 2 |
6 files changed, 36 insertions, 18 deletions
diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h index b7d9f811349..f2a6ce0b129 100644 --- a/source/blender/editors/include/ED_fileselect.h +++ b/source/blender/editors/include/ED_fileselect.h @@ -106,5 +106,7 @@ void ED_fileselect_exit(struct wmWindowManager *wm, struct SpaceFile *sfile); int ED_file_extension_icon(const char *relname); +void ED_file_read_bookmarks(void); + #endif /* __ED_FILESELECT_H__ */ diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 62cf4889797..201abf6934a 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -545,11 +545,16 @@ void fsmenu_refresh_system_category(struct FSMenu *fsmenu) fsmenu_read_system(fsmenu, TRUE); } -void fsmenu_free(struct FSMenu *fsmenu) +void fsmenu_free(void) { - fsmenu_free_category(fsmenu, FS_CATEGORY_SYSTEM); - fsmenu_free_category(fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS); - fsmenu_free_category(fsmenu, FS_CATEGORY_BOOKMARKS); - fsmenu_free_category(fsmenu, FS_CATEGORY_RECENT); - MEM_freeN(fsmenu); + if (g_fsmenu) { + fsmenu_free_category(g_fsmenu, FS_CATEGORY_SYSTEM); + fsmenu_free_category(g_fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS); + fsmenu_free_category(g_fsmenu, FS_CATEGORY_BOOKMARKS); + fsmenu_free_category(g_fsmenu, FS_CATEGORY_RECENT); + MEM_freeN(g_fsmenu); + } + + g_fsmenu = NULL; } + diff --git a/source/blender/editors/space_file/fsmenu.h b/source/blender/editors/space_file/fsmenu.h index eea7e0e3837..01bd4e95afa 100644 --- a/source/blender/editors/space_file/fsmenu.h +++ b/source/blender/editors/space_file/fsmenu.h @@ -84,7 +84,7 @@ void fsmenu_read_bookmarks(struct FSMenu *fsmenu, const char *filename); void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks); /** Free's all the memory associated with the fsmenu */ -void fsmenu_free(struct FSMenu *fsmenu); +void fsmenu_free(void); /** Refresh system directory menu */ void fsmenu_refresh_system_category(struct FSMenu *fsmenu); diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 62048752fa1..170e9336fea 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -637,16 +637,8 @@ void ED_spacetype_file(void) void ED_file_init(void) { - const char * const cfgdir = BLI_get_folder(BLENDER_USER_CONFIG, NULL); - - fsmenu_read_system(fsmenu_get(), TRUE); + ED_file_read_bookmarks(); - if (cfgdir) { - char name[FILE_MAX]; - BLI_make_file_string("/", name, cfgdir, BLENDER_BOOKMARK_FILE); - fsmenu_read_bookmarks(fsmenu_get(), name); - } - if (G.background == FALSE) { filelist_init_icons(); } @@ -656,9 +648,25 @@ void ED_file_init(void) void ED_file_exit(void) { - fsmenu_free(fsmenu_get()); + fsmenu_free(); if (G.background == FALSE) { filelist_free_icons(); } } + +void ED_file_read_bookmarks(void) +{ + const char * const cfgdir = BLI_get_folder(BLENDER_USER_CONFIG, NULL); + + fsmenu_free(); + + fsmenu_read_system(fsmenu_get(), TRUE); + + if (cfgdir) { + char name[FILE_MAX]; + BLI_make_file_string("/", name, cfgdir, BLENDER_BOOKMARK_FILE); + fsmenu_read_bookmarks(fsmenu_get(), name); + } +} + diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index af86e0affea..9c479a2b868 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -97,6 +97,7 @@ #include "IMB_thumbs.h" #include "ED_datafiles.h" +#include "ED_fileselect.h" #include "ED_object.h" #include "ED_screen.h" #include "ED_sculpt.h" @@ -662,7 +663,7 @@ int wm_homefile_read(bContext *C, ReportList *reports, bool from_memory, const c int wm_history_read_exec(bContext *UNUSED(C), wmOperator *UNUSED(op)) { - /* TODO, read bookmarks */ + ED_file_read_bookmarks(); wm_read_history(); return OPERATOR_FINISHED; } diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index 8250a4f3298..a5900f2620c 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -270,6 +270,8 @@ void ED_space_image_set_mask(struct bContext *C, struct SpaceImage *sima, struct void ED_area_tag_redraw_regiontype(struct ScrArea *sa, int regiontype) {STUB_ASSERT(0);} void ED_render_engine_changed(struct Main *bmain) {STUB_ASSERT(0);} +void ED_file_read_bookmarks(void) {STUB_ASSERT(0);} + struct PTCacheEdit *PE_get_current(struct Scene *scene, struct Object *ob) {STUB_ASSERT(0); return (struct PTCacheEdit *) NULL;} void PE_current_changed(struct Scene *scene, struct Object *ob) {STUB_ASSERT(0);} |