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>2021-12-14 01:42:46 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-12-14 01:42:46 +0300
commit2a0a6a0541eaff06659a06ef18cac05e5674c844 (patch)
treec9941f33e1e120bdb2b66a145bfccdeac7f7e67a /source/blender/windowmanager
parenta603bb34591c8b68977b026204658ce602a5dae6 (diff)
Remove G.save_over
The difference between G.save_over and G.relbase_valid was minor. There is one change in functionality. When saving the default-startup file from an already loaded blend file - future save actions will continue to write to the originally loaded file instead of prompting the user to select a location to save the file. This change makes saving the startup file behave the same way "Save a Copy" does. Reviewed By: brecht Ref D13556
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c14
-rw-r--r--source/blender/windowmanager/intern/wm_window.c2
2 files changed, 4 insertions, 12 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index e753c083805..f3cf5dca040 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -957,11 +957,9 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports)
/* When recovering a session from an unsaved file, this can have a blank path. */
if (BKE_main_blendfile_path(bmain)[0] != '\0') {
- G.save_over = 1;
G.relbase_valid = 1;
}
else {
- G.save_over = 0;
G.relbase_valid = 0;
}
@@ -1357,9 +1355,6 @@ void wm_homefile_read_ex(bContext *C,
WM_check(C); /* opens window(s), checks keymaps */
bmain->filepath[0] = '\0';
-
- /* start with save preference untitled.blend */
- G.save_over = 0;
}
{
@@ -1850,8 +1845,6 @@ static bool wm_file_write(bContext *C,
if (use_save_as_copy == false) {
G.relbase_valid = 1;
STRNCPY(bmain->filepath, filepath); /* is guaranteed current file */
-
- G.save_over = 1; /* disable untitled.blend convention */
}
SET_FLAG_FROM_TEST(G.fileflags, fileflags & G_FILE_COMPRESS, G_FILE_COMPRESS);
@@ -2126,7 +2119,6 @@ static int wm_homefile_write_exec(bContext *C, wmOperator *op)
printf("ok\n");
BKE_report(op->reports, RPT_INFO, "Startup file saved");
- G.save_over = 0;
BKE_callback_exec_null(bmain, BKE_CB_EVT_SAVE_POST);
@@ -3011,7 +3003,7 @@ void WM_OT_recover_auto_save(wmOperatorType *ot)
static void wm_filepath_default(char *filepath)
{
- if (G.save_over == false) {
+ if (G.relbase_valid == false) {
BLI_path_filename_ensure(filepath, FILE_MAX, "untitled.blend");
}
}
@@ -3022,7 +3014,7 @@ static void save_set_compress(wmOperator *op)
prop = RNA_struct_find_property(op->ptr, "compress");
if (!RNA_property_is_set(op->ptr, prop)) {
- if (G.save_over) { /* keep flag for existing file */
+ if (G.relbase_valid) { /* keep flag for existing file */
RNA_property_boolean_set(op->ptr, prop, (G.fileflags & G_FILE_COMPRESS) != 0);
}
else { /* use userdef for new file */
@@ -3210,7 +3202,7 @@ static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent *U
}
}
- if (G.save_over) {
+ if (G.relbase_valid) {
char path[FILE_MAX];
RNA_string_get(op->ptr, "filepath", path);
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 86abfe881ff..fbced87d19c 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -428,7 +428,7 @@ void wm_window_title(wmWindowManager *wm, wmWindow *win)
}
else if (win->ghostwin) {
/* this is set to 1 if you don't have startup.blend open */
- if (G.save_over && BKE_main_blendfile_path_from_global()[0]) {
+ if (G.relbase_valid && BKE_main_blendfile_path_from_global()[0]) {
char str[sizeof(((Main *)NULL)->filepath) + 24];
BLI_snprintf(str,
sizeof(str),