diff options
author | Julian Eisel <julian@blender.org> | 2020-11-03 01:55:59 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-11-03 02:00:41 +0300 |
commit | c067b7460a1fb54dc6b21c3cbc2819d9398392ef (patch) | |
tree | f1c2c50728f1b222acf291fda719f438b1adbfbc /source/blender/editors/io | |
parent | a750acab78cf38ca8f010c4ac81ec948faa79dd5 (diff) |
Fix C operators can't set default display or sort type for File Browser
`WM_operator_properties_filesel()` allows C operators to set a display or sort
type for the File Browser to use. But the File Browser would always override
that because of an invalid `_is_set()` check. (The operators don't actually set
the value, they only set the property's default value.)
The only operator affected by this is "Recover Auto Save". It is supposed to
show a vertical list ordered chronologically. It used settings from the
previous File Browser usage before this patch.
Operators using the File Browser should generally use
`FILE_DEFAULTDISPLAY`/`FILE_SORT_DEFAULT` now, except if they have a reason not
to. See comments at their definition.
----
This makes it so operators that set a different display or sort type
don't change the sort or display type for the next File Browser operation.
So using "Recover Auto Save" entirely isolates display and sort type from other
operations.
Differential Revision: https://developer.blender.org/D8598
Reviewed by: Bastien Montagne
Diffstat (limited to 'source/blender/editors/io')
-rw-r--r-- | source/blender/editors/io/io_alembic.c | 4 | ||||
-rw-r--r-- | source/blender/editors/io/io_cache.c | 2 | ||||
-rw-r--r-- | source/blender/editors/io/io_collada.c | 4 | ||||
-rw-r--r-- | source/blender/editors/io/io_usd.c | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/io/io_alembic.c b/source/blender/editors/io/io_alembic.c index 292d8e6066c..70125ff35fc 100644 --- a/source/blender/editors/io/io_alembic.c +++ b/source/blender/editors/io/io_alembic.c @@ -292,7 +292,7 @@ void WM_OT_alembic_export(wmOperatorType *ot) FILE_SAVE, WM_FILESEL_FILEPATH | WM_FILESEL_SHOW_PROPS, FILE_DEFAULTDISPLAY, - FILE_SORT_ALPHA); + FILE_SORT_DEFAULT); RNA_def_int(ot->srna, "start", @@ -677,7 +677,7 @@ void WM_OT_alembic_import(wmOperatorType *ot) FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH | WM_FILESEL_SHOW_PROPS, FILE_DEFAULTDISPLAY, - FILE_SORT_ALPHA); + FILE_SORT_DEFAULT); RNA_def_float( ot->srna, diff --git a/source/blender/editors/io/io_cache.c b/source/blender/editors/io/io_cache.c index 045a293f71b..b73b8abccfe 100644 --- a/source/blender/editors/io/io_cache.c +++ b/source/blender/editors/io/io_cache.c @@ -134,7 +134,7 @@ void CACHEFILE_OT_open(wmOperatorType *ot) FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY, - FILE_SORT_ALPHA); + FILE_SORT_DEFAULT); } /* ***************************** Reload Operator **************************** */ diff --git a/source/blender/editors/io/io_collada.c b/source/blender/editors/io/io_collada.c index 54ef5e6b8c5..af505043e6a 100644 --- a/source/blender/editors/io/io_collada.c +++ b/source/blender/editors/io/io_collada.c @@ -507,7 +507,7 @@ void WM_OT_collada_export(wmOperatorType *ot) FILE_SAVE, WM_FILESEL_FILEPATH | WM_FILESEL_SHOW_PROPS, FILE_DEFAULTDISPLAY, - FILE_SORT_ALPHA); + FILE_SORT_DEFAULT); RNA_def_enum(func, "prop_bc_export_ui_section", @@ -828,7 +828,7 @@ void WM_OT_collada_import(wmOperatorType *ot) FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_SHOW_PROPS, FILE_DEFAULTDISPLAY, - FILE_SORT_ALPHA); + FILE_SORT_DEFAULT); RNA_def_boolean(ot->srna, "import_units", diff --git a/source/blender/editors/io/io_usd.c b/source/blender/editors/io/io_usd.c index 45ea52bdebc..0eadb38abb5 100644 --- a/source/blender/editors/io/io_usd.c +++ b/source/blender/editors/io/io_usd.c @@ -185,7 +185,7 @@ void WM_OT_usd_export(struct wmOperatorType *ot) FILE_SAVE, WM_FILESEL_FILEPATH | WM_FILESEL_SHOW_PROPS, FILE_DEFAULTDISPLAY, - FILE_SORT_ALPHA); + FILE_SORT_DEFAULT); RNA_def_boolean(ot->srna, "selected_objects_only", |