diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-05 16:10:33 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-05 17:33:46 +0300 |
commit | 481cdb08ed6f33a09d0e6843d1024db93c301178 (patch) | |
tree | 77166d130bfff2d5dca884676aaeff6bc0758f96 /source/blender/editors/space_text/text_ops.c | |
parent | 1d97e948d2c4867306e7fb5ce5fccf8b72c13391 (diff) |
Cleanup: use new accessors to blendfile path (Main.name).
Diffstat (limited to 'source/blender/editors/space_text/text_ops.c')
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 3c2d3c557f6..de5ff36f462 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -234,7 +234,7 @@ static int text_open_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "filepath", str); - text = BKE_text_load_ex(bmain, str, bmain->name, internal); + text = BKE_text_load_ex(bmain, str, BKE_main_blendfile_path(bmain), internal); if (!text) { if (op->customdata) MEM_freeN(op->customdata); @@ -274,7 +274,7 @@ static int text_open_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(e { Main *bmain = CTX_data_main(C); Text *text = CTX_data_edit_text(C); - const char *path = (text && text->name) ? text->name : bmain->name; + const char *path = (text && text->name) ? text->name : BKE_main_blendfile_path(bmain); if (RNA_struct_property_is_set(op->ptr, "filepath")) return text_open_exec(C, op); @@ -465,7 +465,7 @@ static void txt_write_file(Main *bmain, Text *text, ReportList *reports) char filepath[FILE_MAX]; BLI_strncpy(filepath, text->name, FILE_MAX); - BLI_path_abs(filepath, bmain->name); + BLI_path_abs(filepath, BKE_main_blendfile_path(bmain)); fp = BLI_fopen(filepath, "w"); if (fp == NULL) { @@ -562,7 +562,7 @@ static int text_save_as_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSE else if (text->flags & TXT_ISMEM) str = text->id.name + 2; else - str = bmain->name; + str = BKE_main_blendfile_path(bmain); RNA_string_set(op->ptr, "filepath", str); WM_event_add_fileselect(C, op); |