diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2019-09-16 19:14:23 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2019-09-16 19:25:31 +0300 |
commit | 8d6b0eda5db45b63de8fccea1e3af41bf0bf09e0 (patch) | |
tree | 2f49c918125a63460b3878346425efcd44b799c4 /source/blender/editors/space_file/file_ops.c | |
parent | 3618b2c3599d172cad3e0ee3fa7bd0eb886771a2 (diff) |
UI: Show in-/decrement buttons for exporters
As per Brecht's suggestion, use the check_existing property to control
visibility of the '+' and '-' icons. It is typically set for save
operations.
Adds another FileSelectParams flag (to avoid duplicated propertie
lookups) and removes the recently introduced
FileSelectParams.action_type again.
Fixes T69881.
Diffstat (limited to 'source/blender/editors/space_file/file_ops.c')
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 127196cca74..b741a255383 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -1506,14 +1506,11 @@ void file_draw_check_cb(bContext *C, void *UNUSED(arg1), void *UNUSED(arg2)) bool file_draw_check_exists(SpaceFile *sfile) { if (sfile->op) { /* fails on reload */ - PropertyRNA *prop; - if ((prop = RNA_struct_find_property(sfile->op->ptr, "check_existing"))) { - if (RNA_property_boolean_get(sfile->op->ptr, prop)) { - char filepath[FILE_MAX]; - BLI_join_dirfile(filepath, sizeof(filepath), sfile->params->dir, sfile->params->file); - if (BLI_is_file(filepath)) { - return true; - } + if (sfile->params && (sfile->params->flag & FILE_CHECK_EXISTING)) { + char filepath[FILE_MAX]; + BLI_join_dirfile(filepath, sizeof(filepath), sfile->params->dir, sfile->params->file); + if (BLI_is_file(filepath)) { + return true; } } } @@ -2398,7 +2395,7 @@ static bool file_filenum_poll(bContext *C) return false; } - return sfile->params && (sfile->params->action_type == FILE_SAVE); + return sfile->params && (sfile->params->flag & FILE_CHECK_EXISTING); } /** |