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>2013-04-10 13:49:44 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-04-10 13:49:44 +0400
commit076932c7cbb5fdb9942ccb55baf4f813cc70ae08 (patch)
treed284974e7f34c43e9d915fc20b1cfb0393a2d8bd /source/blender/windowmanager
parenta963e7ae4245f2ab393bd1f78ec6ea00fd4c7ef2 (diff)
alternate solution for r55921 which was calling invoke() from exec(), which shouldnt be done.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c9
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c9
2 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index f8cd154df35..7a528e41995 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -395,7 +395,14 @@ void WM_file_read(bContext *C, const char *filepath, ReportList *reports)
/* confusing this global... */
G.relbase_valid = 1;
retval = BKE_read_file(C, filepath, reports);
- G.save_over = 1;
+ /* when loading startup.blend's, we can be left with a blank path */
+ if (G.main->name[0]) {
+ G.save_over = 1;
+ }
+ else {
+ G.save_over = 0;
+ G.relbase_valid = 0;
+ }
/* this flag is initialized by the operator but overwritten on read.
* need to re-enable it here else drivers + registered scripts wont work. */
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index f8628578fd8..1fac48259c1 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2376,7 +2376,6 @@ static int wm_save_as_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent
}
/* function used for WM_OT_save_mainfile too */
-static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event));
static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op)
{
char path[FILE_MAX];
@@ -2387,13 +2386,7 @@ static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op)
if (RNA_struct_property_is_set(op->ptr, "filepath"))
RNA_string_get(op->ptr, "filepath", path);
else {
- /* if file has no name, then treat like startup file */
- if (G.main->name[0] == 0) {
- G.save_over = false;
- return wm_save_mainfile_invoke(C, op, (wmEvent *)NULL);
- }
- else
- BLI_strncpy(path, G.main->name, FILE_MAX);
+ BLI_strncpy(path, G.main->name, FILE_MAX);
untitled(path);
}