Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-06-02 21:52:06 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-06-02 21:52:06 +0400
commitd8c2709414ec3b25c2bdaeea57eb26c2ff91f977 (patch)
tree590b4a6151a11ad2618a834aea2dfc4eafe49761 /source/blender/editors/space_text
parent5506ab080d1f03acd9e0e09a43b244b2ccece544 (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')
-rw-r--r--source/blender/editors/space_text/text_ops.c9
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);