[Bf-blender-cvs] [4fa774b5334] master: Fix: Fullscreen File Browser showing override warning on file open

Julian Eisel noreply at git.blender.org
Tue Dec 10 17:11:17 CET 2019


Commit: 4fa774b53346a1533c6c0c62ddbd220979adb6c2
Author: Julian Eisel
Date:   Tue Dec 10 17:01:53 2019 +0100
Branches: master
https://developer.blender.org/rB4fa774b53346a1533c6c0c62ddbd220979adb6c2

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.

===================================================================

M	source/blender/editors/space_file/filesel.c

===================================================================

diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index f8adf9b707a..99e4fc62980 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -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;
     }



More information about the Bf-blender-cvs mailing list