diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-12-16 03:38:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-12-16 03:41:46 +0300 |
commit | 5de109cc2d220ca3bd731216b9cd521269ad663e (patch) | |
tree | a97d9cff164edd723aa66c81b78281b5cf99ef24 /source/blender/editors/space_file | |
parent | 4b12f521e38fedf09485e0436e339031f363130a (diff) |
Remove G.relbase_valid
In almost all cases there is no difference between `G.relbase_valid`
and checking `G.main->filepath` isn't an empty string.
In many places a non-empty string is already being used instead of
`G.relbase_valid`.
The only situation where this was needed was when saving from
`wm_file_write` where they temporarily became out of sync.
This has been replaced by adding a new member to `BlendFileWriteParams`
to account for saving an unsaved file for the first time.
Reviewed By: brecht
Ref D13564
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 76a0e4f42e7..8178e54e023 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -2463,9 +2463,10 @@ static void file_expand_directory(bContext *C) if (params) { if (BLI_path_is_rel(params->dir)) { /* Use of 'default' folder here is just to avoid an error message on '//' prefix. */ + const char *blendfile_path = BKE_main_blendfile_path(bmain); BLI_path_abs(params->dir, - G.relbase_valid ? BKE_main_blendfile_path(bmain) : - BKE_appdir_folder_default_or_root()); + (blendfile_path[0] != '\0') ? blendfile_path : + BKE_appdir_folder_default_or_root()); } else if (params->dir[0] == '~') { char tmpstr[sizeof(params->dir) - 1]; |