diff options
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_edit.c')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index cb95e9a75de..415bb5898a9 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -54,6 +54,7 @@ #include "RNA_prototypes.h" /* For menu, popup, icons, etc. */ +#include "ED_fileselect.h" #include "ED_keyframing.h" #include "ED_numinput.h" #include "ED_outliner.h" @@ -1931,7 +1932,7 @@ static int sequencer_meta_toggle_exec(bContext *C, wmOperator *UNUSED(op)) SEQ_select_active_set(scene, meta_parent); } - // DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); + DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); return OPERATOR_FINISHED; @@ -2637,12 +2638,12 @@ static int sequencer_swap_data_exec(bContext *C, wmOperator *op) Sequence *seq_other; const char *error_msg; - if (SEQ_select_active_get_pair(scene, &seq_act, &seq_other) == 0) { + if (SEQ_select_active_get_pair(scene, &seq_act, &seq_other) == false) { BKE_report(op->reports, RPT_ERROR, "Please select two strips"); return OPERATOR_CANCELLED; } - if (SEQ_edit_sequence_swap(scene, seq_act, seq_other, &error_msg) == 0) { + if (SEQ_edit_sequence_swap(scene, seq_act, seq_other, &error_msg) == false) { BKE_report(op->reports, RPT_ERROR, error_msg); return OPERATOR_CANCELLED; } @@ -2869,7 +2870,7 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "directory", directory); if (is_relative_path) { - /* TODO(campbell): shouldn't this already be relative from the filesel? + /* TODO(@campbellbarton): shouldn't this already be relative from the filesel? * (as the 'filepath' is) for now just make relative here, * but look into changing after 2.60. */ BLI_path_rel(directory, BKE_main_blendfile_path(bmain)); @@ -3076,7 +3077,7 @@ static int seq_cmp_time_startdisp_channel(void *thunk, const void *a, const void int seq_a_start = SEQ_time_left_handle_frame_get(scene, seq_a); int seq_b_start = SEQ_time_left_handle_frame_get(scene, seq_b); - /* If strips have the same start frame favor the one with a higher channel.*/ + /* If strips have the same start frame favor the one with a higher channel. */ if (seq_a_start == seq_b_start) { return seq_a->machine > seq_b->machine; } @@ -3088,20 +3089,7 @@ static int sequencer_export_subtitles_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { - Main *bmain = CTX_data_main(C); - if (!RNA_struct_property_is_set(op->ptr, "filepath")) { - char filepath[FILE_MAX]; - - if (BKE_main_blendfile_path(bmain)[0] == '\0') { - BLI_strncpy(filepath, "untitled", sizeof(filepath)); - } - else { - BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath)); - } - - BLI_path_extension_replace(filepath, sizeof(filepath), ".srt"); - RNA_string_set(op->ptr, "filepath", filepath); - } + ED_fileselect_ensure_default_filepath(C, op, ".srt"); WM_event_add_fileselect(C, op); @@ -3136,7 +3124,7 @@ static int sequencer_export_subtitles_exec(bContext *C, wmOperator *op) FILE *file; char filepath[FILE_MAX]; - if (!RNA_struct_property_is_set(op->ptr, "filepath")) { + if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) { BKE_report(op->reports, RPT_ERROR, "No filename given"); return OPERATOR_CANCELLED; } |