Fix: Fullscreen File Browser showing override warning on file open

Steps to reproduce were:
* Change File Browser display mode to fullscreen in Preferences
* File > Save As (make sure existing .blend is selected)
* File > Open
The file name would still be shown in red and the + and - icons would be
visible, which should only be the case for saving files, not opening.

Note that this change makes all `FileSelectParams.flag` values be reset
on re-opening a File Browser, which *may* in fact cause other issues.
It's easy to fix those though, and I'd prefer properly resetting the
flags and only keeping specific ones in that case.
This commit is contained in:
Julian Eisel 2019-12-10 17:01:53 +01:00
parent c5767a24b9
commit 4fa774b533
1 changed files with 1 additions and 4 deletions

View File

@ -160,14 +160,11 @@ short ED_fileselect_set_params(SpaceFile *sfile)
BLI_path_abs(params->dir, blendfile_path);
}
params->flag = 0;
if (is_directory == true && is_filename == false && is_filepath == false &&
is_files == false) {
params->flag |= FILE_DIRSEL_ONLY;
}
else {
params->flag &= ~FILE_DIRSEL_ONLY;
}
if ((prop = RNA_struct_find_property(op->ptr, "check_existing"))) {
params->flag |= RNA_property_boolean_get(op->ptr, prop) ? FILE_CHECK_EXISTING : 0;
}