diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-06-02 21:52:06 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-06-02 21:52:06 +0400 |
commit | d8c2709414ec3b25c2bdaeea57eb26c2ff91f977 (patch) | |
tree | 590b4a6151a11ad2618a834aea2dfc4eafe49761 /source/blender/editors/space_text/text_ops.c | |
parent | 5506ab080d1f03acd9e0e09a43b244b2ccece544 (diff) |
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.
Diffstat (limited to 'source/blender/editors/space_text/text_ops.c')
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 9 |
1 files changed, 1 insertions, 8 deletions
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); |