[Bf-blender-cvs] [e17967f890a] master: Fix T83559: File Browser uses wrong operation

Julian Eisel noreply at git.blender.org
Tue Dec 8 21:24:38 CET 2020


Commit: e17967f890a09c3bd810632c2c3244f9f988919f
Author: Julian Eisel
Date:   Tue Dec 8 21:19:22 2020 +0100
Branches: master
https://developer.blender.org/rBe17967f890a09c3bd810632c2c3244f9f988919f

Fix T83559: File Browser uses wrong operation

When opening a temporary File Browser, we have to make sure the file selection
parameters are refreshed. When opening it in a new Window that would always be
the case, if the File Browser uses a maximized window (as set in the
Preferences), it might reuse space-data from a previous use. So we have to
force the refresh.
Also renamed the relevant function to be more clear about what it's doing.

Mistake in 95b3c4c966f9.

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

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 ffa44083473..6e933e53a8f 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -90,7 +90,7 @@ FileSelectParams *ED_fileselect_get_active_params(const SpaceFile *sfile)
 /**
  * \note RNA_struct_property_is_set_ex is used here because we want
  *       the previously used settings to be used here rather than overriding them */
-static void fileselect_ensure_file_params(SpaceFile *sfile)
+static FileSelectParams *fileselect_ensure_updated_file_params(SpaceFile *sfile)
 {
   FileSelectParams *params;
   wmOperator *op = sfile->op;
@@ -323,12 +323,14 @@ static void fileselect_ensure_file_params(SpaceFile *sfile)
   if (sfile->layout) {
     sfile->layout->dirty = true;
   }
+
+  return params;
 }
 
 FileSelectParams *ED_fileselect_ensure_active_params(SpaceFile *sfile)
 {
   if (!sfile->params) {
-    fileselect_ensure_file_params(sfile);
+    fileselect_ensure_updated_file_params(sfile);
   }
   return sfile->params;
 }
@@ -369,7 +371,7 @@ void ED_fileselect_set_params_from_userdef(SpaceFile *sfile)
   wmOperator *op = sfile->op;
   UserDef_FileSpaceData *sfile_udata = &U.file_space_data;
 
-  FileSelectParams *params = ED_fileselect_ensure_active_params(sfile);
+  FileSelectParams *params = fileselect_ensure_updated_file_params(sfile);
   if (!op) {
     return;
   }



More information about the Bf-blender-cvs mailing list