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:
authorCampbell Barton <ideasman42@gmail.com>2012-08-05 18:11:51 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-05 18:11:51 +0400
commit0a35e050f3139a55e98f17c88875d76f433e371a (patch)
tree70e7afa5e6476a7346f38453f3647b1013e1f3b4 /source/blender/editors/sound/sound_ops.c
parent9ddbd8329e51582a0a5a1e6e397d2f75e5e9c0d6 (diff)
code cleanup: remove redundant calls to CTX_data_main()
Diffstat (limited to 'source/blender/editors/sound/sound_ops.c')
-rw-r--r--source/blender/editors/sound/sound_ops.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c
index 53ca256be0c..aaa1328f9f6 100644
--- a/source/blender/editors/sound/sound_ops.c
+++ b/source/blender/editors/sound/sound_ops.c
@@ -701,7 +701,7 @@ static int sound_pack_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
sound->packedfile = newPackedFile(op->reports, sound->name, ID_BLEND_PATH(bmain, &sound->id));
- sound_load(CTX_data_main(C), sound);
+ sound_load(bmain, sound);
return OPERATOR_FINISHED;
}
@@ -725,6 +725,7 @@ static void SOUND_OT_pack(wmOperatorType *ot)
static int sound_unpack_exec(bContext *C, wmOperator *op)
{
+ Main *bmain = CTX_data_main(C);
int method = RNA_enum_get(op->ptr, "method");
bSound *sound = NULL;
@@ -732,7 +733,7 @@ static int sound_unpack_exec(bContext *C, wmOperator *op)
if (RNA_struct_property_is_set(op->ptr, "id")) {
char sndname[MAX_ID_NAME - 2];
RNA_string_get(op->ptr, "id", sndname);
- sound = BLI_findstring(&CTX_data_main(C)->sound, sndname, offsetof(ID, name) + 2);
+ sound = BLI_findstring(&bmain->sound, sndname, offsetof(ID, name) + 2);
}
if (!sound || !sound->packedfile)
@@ -741,7 +742,7 @@ static int sound_unpack_exec(bContext *C, wmOperator *op)
if (G.fileflags & G_AUTOPACK)
BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save");
- unpackSound(CTX_data_main(C), op->reports, sound, method);
+ unpackSound(bmain, op->reports, sound, method);
return OPERATOR_FINISHED;
}