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:
authorCampbell Barton <ideasman42@gmail.com>2010-08-25 08:03:38 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-25 08:03:38 +0400
commitb54d16858f54452361921629a150b5115235c5fa (patch)
tree8fa8b0a6140ec2fbb9da23fc93023a28dcac624b /source/blender/blenkernel
parent8ffc50e45cc04f69c03dbdda9b331328ec840121 (diff)
bugfix [#23456] context.main.filepath lost after undo
G.sce was being restored after undo but not G.main->name also changed reading a new file so G.main->name gets set to the startup.blend even if its not on the disk, not ideal but would set to <memory2> otherwise.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/blender.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 292d7be48d6..a4f44dd0a48 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -460,13 +460,16 @@ static UndoElem *curundo= NULL;
static int read_undosave(bContext *C, UndoElem *uel)
{
- char scestr[FILE_MAXDIR+FILE_MAXFILE];
+ char scestr[FILE_MAXDIR+FILE_MAXFILE]; /* we should eventually just use G.main->name */
+ char mainstr[FILE_MAXDIR+FILE_MAXFILE];
int success=0, fileflags;
/* This is needed so undoing/redoing doesnt crash with threaded previews going */
WM_jobs_stop_all(CTX_wm_manager(C));
strcpy(scestr, G.sce); /* temporal store */
+ strcpy(mainstr, G.main->name); /* temporal store */
+
fileflags= G.fileflags;
G.fileflags |= G_FILE_NO_UI;
@@ -476,7 +479,8 @@ static int read_undosave(bContext *C, UndoElem *uel)
success= BKE_read_file_from_memfile(C, &uel->memfile, NULL);
/* restore */
- strcpy(G.sce, scestr);
+ strcpy(G.sce, scestr); /* restore */
+ strcpy(G.main->name, mainstr); /* restore */
G.fileflags= fileflags;
if(success)