From d8c2709414ec3b25c2bdaeea57eb26c2ff91f977 Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Sun, 2 Jun 2013 17:52:06 +0000 Subject: Better API design for making text datablocks after loading. An optional 'internal' argument was added to the bpy.data.texts.load() operator. The changes in revision 57153 were reverted, so that the is_in_memory and is_dirty properties of text datablocks are not editable again. In the C API layer, BKE_text_load_ex() was introduced to allow for optionally making text datablocks internal after loading. --- source/blender/editors/space_text/text_ops.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'source/blender/editors/space_text') diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 04675430339..ca6bab1d1da 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -238,7 +238,7 @@ static int text_open_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "filepath", str); - text = BKE_text_load(bmain, str, G.main->name); + text = BKE_text_load_ex(bmain, str, G.main->name, internal); if (!text) { if (op->customdata) MEM_freeN(op->customdata); @@ -264,13 +264,6 @@ static int text_open_exec(bContext *C, wmOperator *op) st->text = text; st->top = 0; } - - if (internal) { - if (text->name) - MEM_freeN(text->name); - - text->name = NULL; - } text_drawcache_tag_update(st, 1); WM_event_add_notifier(C, NC_TEXT | NA_ADDED, text); -- cgit v1.2.3