From 051e186d5c61dccfc776b8da9b83c598421be4e7 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 1 Jun 2018 17:08:38 +0200 Subject: Cleanup: some more G.main removal from editor code. --- source/blender/editors/space_sequencer/sequencer_edit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_sequencer/sequencer_edit.c') diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 0895d28fba7..a052b76e853 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -3885,13 +3885,14 @@ void SEQUENCER_OT_change_path(struct wmOperatorType *ot) 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 (G.main->name[0] == 0) + if (bmain->name[0] == '\0') BLI_strncpy(filepath, "untitled", sizeof(filepath)); else - BLI_strncpy(filepath, G.main->name, sizeof(filepath)); + BLI_strncpy(filepath, bmain->name, sizeof(filepath)); BLI_replace_extension(filepath, sizeof(filepath), ".srt"); RNA_string_set(op->ptr, "filepath", filepath); -- cgit v1.2.3