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-03-11 16:34:19 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-03-11 16:40:25 +0300
commitf7616c6eaf8d983e84aeb838d51fe67e4fa98e16 (patch)
tree2154811d77a2ce3b8a7c8e9165a84477b8534999 /source/blender/windowmanager/intern
parent93f8c9b8238b4f69c34b605b7e08dfe113f4023d (diff)
Cleanup: file loading/recover checks
- Don't set G.relbase_valid until the file is loaded. - Remove unnecessary string pointer comparison. - Remove unused filename being passed to 'setup_app_data'.
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 13f3afdfc4c..8a8baad0df0 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -729,8 +729,6 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports)
/* also exit screens and editors */
wm_window_match_init(C, &wmbase);
- /* confusing this global... */
- G.relbase_valid = 1;
success = BKE_blendfile_read(
C,
filepath,
@@ -746,9 +744,10 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports)
/* BKE_file_read sets new Main into context. */
Main *bmain = CTX_data_main(C);
- /* when loading startup.blend's, we can be left with a blank path */
+ /* 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;