diff options
author | Ton Roosendaal <ton@blender.org> | 2009-04-30 20:44:00 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-04-30 20:44:00 +0400 |
commit | 3ee6c11e31dcebc0999e335818cc07520dff5389 (patch) | |
tree | 7e96b0e2b5385df6be6012e9c78d071d18128a9a | |
parent | 140a60539bb03d4f843e6d6f5aa47e7d726b0971 (diff) |
2.5
Two fixes:
- objects in editmode now update data on saving .blend
- uifonts and uistyles were not freed yet on reading files
yet.
-rw-r--r-- | source/blender/blenkernel/BKE_blender.h | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/blender.c | 13 | ||||
-rw-r--r-- | source/blender/editors/interface/interface.c | 1 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 1 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_style.c | 8 | ||||
-rw-r--r-- | source/blender/editors/object/object_edit.c | 23 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 7 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_init_exit.c | 2 |
8 files changed, 29 insertions, 29 deletions
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 5a374802d36..795c7585b9c 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -55,6 +55,9 @@ int BKE_read_file_from_memfile(struct bContext *C, struct MemFile *memfile, stru void free_blender(void); void initglobals(void); +/* load new userdef from file, exit blender */ +void BKE_userdef_free(void); + /* set this callback when a UI is running */ void set_blender_test_break_cb(void (*func)(void) ); int blender_test_break(void); diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 2033250585d..3169905b7f5 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -325,8 +325,8 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, char *filename) if (bfd->user) { /* only here free userdef themes... */ - BLI_freelistN(&U.themes); - + BKE_userdef_free(); + U= *bfd->user; MEM_freeN(bfd->user); } @@ -414,6 +414,15 @@ static void handle_subversion_warning(Main *main) } +void BKE_userdef_free(void) +{ + + BLI_freelistN(&U.uistyles); + BLI_freelistN(&U.uifonts); + BLI_freelistN(&U.themes); + +} + /* returns: 0: no load file 1: OK diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index fa25153a158..8a1086386e1 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -3059,7 +3059,6 @@ void UI_init_userdef(void) void UI_exit(void) { - uiStyleExit(); ui_resources_free(); } diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 8aaec7f31b0..83cea53e5fa 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -382,7 +382,6 @@ void ui_widget_color_init(struct ThemeUI *tui); /* interface_style.c */ void uiStyleInit(void); -void uiStyleExit(void); /* resources.c */ void init_userdef_do_versions(void); diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index db5dacf5a75..8c07a6ea0ab 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -264,14 +264,6 @@ void uiStyleInit(void) } } - -void uiStyleExit(void) -{ - BLI_freelistN(&U.uifonts); - BLI_freelistN(&U.uistyles); - -} - void uiStyleFontSet(uiFontStyle *fs) { uiFont *font= uifont_to_blfont(fs->uifont_id); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 2ec9d1aed37..234a1cc0ea4 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -3204,7 +3204,6 @@ void ED_object_exit_editmode(bContext *C, int flag) { Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); - Object *ob; int freedata = flag & EM_FREEDATA; if(obedit==NULL) return; @@ -3252,22 +3251,20 @@ void ED_object_exit_editmode(bContext *C, int flag) // if(freedata) BLI_freelistN(&editelems); } - ob= obedit; - - /* for example; displist make is different in editmode */ - if(freedata) obedit= NULL; - scene->obedit= obedit; // XXX for context - - /* also flush ob recalc, doesn't take much overhead, but used for particles */ - DAG_object_flush_update(scene, ob, OB_RECALC_OB|OB_RECALC_DATA); + /* freedata only 0 now on file saves */ + if(freedata) { + /* for example; displist make is different in editmode */ + scene->obedit= NULL; // XXX for context + + /* also flush ob recalc, doesn't take much overhead, but used for particles */ + DAG_object_flush_update(scene, obedit, OB_RECALC_OB|OB_RECALC_DATA); - if(obedit==NULL) // XXX && (flag & EM_FREEUNDO)) ED_undo_push(C, "Editmode"); - if(flag & EM_WAITCURSOR) waitcursor(0); + if(flag & EM_WAITCURSOR) waitcursor(0); - WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_OBJECT, scene); - + WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_OBJECT, scene); + } } diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 5e27b0da70d..6bd5b9e0c6c 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -78,6 +78,7 @@ #include "RNA_define.h" #include "ED_datafiles.h" +#include "ED_object.h" #include "ED_screen.h" #include "ED_util.h" @@ -569,16 +570,16 @@ void WM_write_file(bContext *C, char *target, ReportList *reports) strcpy(di, target); } - if (BLI_exists(di)) { +// if (BLI_exists(di)) { // XXX if(!saveover(di)) // XXX return; - } +// } if (G.fileflags & G_AUTOPACK) { packAll(); } -// XXX waitcursor(1); // exit_editmode sets cursor too + ED_object_exit_editmode(C, 0); do_history(di, reports); diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 64d61210c14..d394a4d6eee 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -264,7 +264,7 @@ void WM_exit(bContext *C) ED_file_exit(); /* for fsmenu */ UI_exit(); - BLI_freelistN(&U.themes); + BKE_userdef_free(); RNA_exit(); |