diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-04-24 15:42:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-04-25 12:27:45 +0300 |
commit | beaa57d2699ae945c06a895d41ec5ddfeabc373a (patch) | |
tree | 205db121401f06eb1d51a98cd2480b46ae52c582 /source/blender/windowmanager/intern/wm_files.c | |
parent | 935998312c44300385588c466ef31fa9e85d385f (diff) |
Refactor BKE_blender into separate headers
- BKE_blender_version.h (only version defines & versionstr).
- BKE_blender_copybuffer.h (currently only used for view3d copy/paste).
- BKE_blender_undo.h (global undo functions).
- BKE_blendfile.h (high level blend file read/write API).
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 498a3f5bdda..5e74eff645d 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -74,6 +74,8 @@ #include "BKE_utildefines.h" #include "BKE_autoexec.h" #include "BKE_blender.h" +#include "BKE_blendfile.h" +#include "BKE_blender_undo.h" #include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_global.h" @@ -341,7 +343,7 @@ static void wm_init_userdef(bContext *C, const bool from_memory) /* update tempdir from user preferences */ BKE_tempdir_init(U.tempdir); - BKE_userdef_state(); + BKE_blender_userdef_refresh(); } @@ -551,7 +553,7 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports) /* confusing this global... */ G.relbase_valid = 1; - retval = BKE_read_file(C, filepath, reports); + retval = BKE_blendfile_read(C, filepath, reports); /* when loading startup.blend's, we can be left with a blank path */ if (G.main->name[0]) { G.save_over = 1; @@ -572,12 +574,12 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports) wm_window_match_do(C, &wmbase); WM_check(C); /* opens window(s), checks keymaps */ - if (retval == BKE_READ_FILE_OK_USERPREFS) { + if (retval == BKE_BLENDFILE_READ_OK_USERPREFS) { /* in case a userdef is read from regular .blend */ wm_init_userdef(C, false); } - if (retval != BKE_READ_FILE_FAIL) { + if (retval != BKE_BLENDFILE_READ_FAIL) { if (do_history) { wm_history_file_update(); } @@ -690,7 +692,7 @@ int wm_homefile_read(bContext *C, ReportList *reports, bool from_memory, const c if (!from_memory) { if (BLI_access(startstr, R_OK) == 0) { - success = (BKE_read_file(C, startstr, NULL) != BKE_READ_FILE_FAIL); + success = (BKE_blendfile_read(C, startstr, NULL) != BKE_BLENDFILE_READ_FAIL); } if (BLI_listbase_is_empty(&U.themes)) { if (G.debug & G_DEBUG) @@ -705,7 +707,7 @@ int wm_homefile_read(bContext *C, ReportList *reports, bool from_memory, const c } if (success == 0) { - success = BKE_read_file_from_memory(C, datatoc_startup_blend, datatoc_startup_blend_size, NULL, true); + success = BKE_blendfile_read_from_memory(C, datatoc_startup_blend, datatoc_startup_blend_size, NULL, true); if (BLI_listbase_is_empty(&wmbase)) { wm_clear_default_size(C); } @@ -720,8 +722,8 @@ int wm_homefile_read(bContext *C, ReportList *reports, bool from_memory, const c /* check new prefs only after startup.blend was finished */ if (!from_memory && BLI_exists(prefstr)) { - int done = BKE_read_file_userdef(prefstr, NULL); - if (done != BKE_READ_FILE_FAIL) { + int done = BKE_blendfile_read_userdef(prefstr, NULL); + if (done != BKE_BLENDFILE_READ_FAIL) { read_userdef_from_memory = false; printf("Read new prefs: %s\n", prefstr); } @@ -1352,7 +1354,7 @@ static int wm_userpref_write_exec(bContext *C, wmOperator *op) BLI_make_file_string("/", filepath, BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL), BLENDER_USERPREF_FILE); printf("trying to save userpref at %s ", filepath); - if (BKE_write_file_userdef(filepath, op->reports) == 0) { + if (BKE_blendfile_write_userdef(filepath, op->reports) == 0) { printf("fail\n"); return OPERATOR_CANCELLED; } |