From 084d545202c27fda5117817491c8d5761b4daafc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 7 Jul 2019 23:57:35 +1000 Subject: Cleanup: use BKE_packedfile prefix for function names Avoid ambiguity with terms check & compare. --- source/blender/editors/interface/interface_templates.c | 2 +- source/blender/editors/sound/sound_ops.c | 5 +++-- source/blender/editors/space_image/image_ops.c | 10 +++++----- source/blender/editors/space_info/info_ops.c | 14 +++++++------- source/blender/editors/util/ed_util.c | 4 ++-- 5 files changed, 18 insertions(+), 17 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 5d3ef5c625e..1fc1af9815f 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -952,7 +952,7 @@ static void template_ID(bContext *C, /* Due to space limit in UI - skip the "open" icon for packed data, and allow to unpack. * Only for images, sound and fonts */ - if (id && BKE_pack_check(id)) { + if (id && BKE_packedfile_id_check(id)) { but = uiDefIconButO(block, UI_BTYPE_BUT, "FILE_OT_unpack_item", diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 30ddd8c7d33..f4191f87df6 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -765,7 +765,8 @@ 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->packedfile = BKE_packedfile_new( + op->reports, sound->name, ID_BLEND_PATH(bmain, &sound->id)); BKE_sound_load(bmain, sound); return OPERATOR_FINISHED; @@ -811,7 +812,7 @@ static int sound_unpack_exec(bContext *C, wmOperator *op) "AutoPack is enabled, so image will be packed again on file save"); } - unpackSound(bmain, op->reports, sound, method); + BKE_packedfile_unpack_sound(bmain, op->reports, sound, method); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 96eaa89d175..b79ed1c83c4 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1391,7 +1391,7 @@ static int image_open_exec(bContext *C, wmOperator *op) BKE_image_init_imageuser(ima, iuser); } - /* XXX unpackImage frees image buffers */ + /* XXX BKE_packedfile_unpack_image frees image buffers */ ED_preview_kill_jobs(CTX_wm_manager(C), bmain); BKE_image_signal(bmain, ima, iuser, IMA_SIGNAL_RELOAD); @@ -1601,7 +1601,7 @@ static int image_replace_exec(bContext *C, wmOperator *op) sima->image->source = IMA_SRC_FILE; } - /* XXX unpackImage frees image buffers */ + /* XXX BKE_packedfile_unpack_image frees image buffers */ ED_preview_kill_jobs(CTX_wm_manager(C), CTX_data_main(C)); BKE_icon_changed(BKE_icon_id_ensure(&sima->image->id)); @@ -2401,7 +2401,7 @@ static int image_reload_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_CANCELLED; } - /* XXX unpackImage frees image buffers */ + /* XXX BKE_packedfile_unpack_image frees image buffers */ ED_preview_kill_jobs(CTX_wm_manager(C), CTX_data_main(C)); BKE_image_signal(bmain, ima, iuser, IMA_SIGNAL_RELOAD); @@ -2859,10 +2859,10 @@ static int image_unpack_exec(bContext *C, wmOperator *op) "AutoPack is enabled, so image will be packed again on file save"); } - /* XXX unpackImage frees image buffers */ + /* XXX BKE_packedfile_unpack_image frees image buffers */ ED_preview_kill_jobs(CTX_wm_manager(C), CTX_data_main(C)); - unpackImage(CTX_data_main(C), op->reports, ima, method); + BKE_packedfile_unpack_image(CTX_data_main(C), op->reports, ima, method); WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, ima); diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c index bf43e493cc5..6460c3db8c2 100644 --- a/source/blender/editors/space_info/info_ops.c +++ b/source/blender/editors/space_info/info_ops.c @@ -65,7 +65,7 @@ static int pack_libraries_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); - packLibraries(bmain, op->reports); + BKE_packedfile_pack_all_libraries(bmain, op->reports); return OPERATOR_FINISHED; } @@ -88,7 +88,7 @@ static int unpack_libraries_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); - unpackLibraries(bmain, op->reports); + BKE_packedfile_unpack_all_libraries(bmain, op->reports); return OPERATOR_FINISHED; } @@ -124,7 +124,7 @@ static int autopack_toggle_exec(bContext *C, wmOperator *op) G.fileflags &= ~G_FILE_AUTOPACK; } else { - packAll(bmain, op->reports, true); + BKE_packedfile_pack_all(bmain, op->reports, true); G.fileflags |= G_FILE_AUTOPACK; } @@ -151,7 +151,7 @@ static int pack_all_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); - packAll(bmain, op->reports, true); + BKE_packedfile_pack_all(bmain, op->reports, true); return OPERATOR_FINISHED; } @@ -221,7 +221,7 @@ static int unpack_all_exec(bContext *C, wmOperator *op) int method = RNA_enum_get(op->ptr, "method"); if (method != PF_KEEP) { - unpackAll(bmain, op->reports, method); /* XXX PF_ASK can't work here */ + BKE_packedfile_unpack_all(bmain, op->reports, method); /* XXX PF_ASK can't work here */ } G.fileflags &= ~G_FILE_AUTOPACK; @@ -236,7 +236,7 @@ static int unpack_all_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED( char title[64]; int count = 0; - count = countPackedFiles(bmain); + count = BKE_packedfile_count_all(bmain); if (!count) { BKE_report(op->reports, RPT_WARNING, "No packed files to unpack"); @@ -321,7 +321,7 @@ static int unpack_item_exec(bContext *C, wmOperator *op) } if (method != PF_KEEP) { - BKE_unpack_id(bmain, id, op->reports, method); /* XXX PF_ASK can't work here */ + BKE_packedfile_id_unpack(bmain, id, op->reports, method); /* XXX PF_ASK can't work here */ } G.fileflags &= ~G_FILE_AUTOPACK; diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 1ee8ff6966c..fd0f7fd47c4 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -326,7 +326,7 @@ void unpack_menu(bContext *C, BLI_split_file_part(abs_name, fi, sizeof(fi)); BLI_snprintf(local_name, sizeof(local_name), "//%s/%s", folder, fi); if (!STREQ(abs_name, local_name)) { - switch (checkPackedFile(BKE_main_blendfile_path(bmain), local_name, pf)) { + switch (BKE_packedfile_compare_to_file(BKE_main_blendfile_path(bmain), local_name, pf)) { case PF_NOFILE: BLI_snprintf(line, sizeof(line), TIP_("Create %s"), local_name); uiItemFullO_ptr(layout, ot, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, 0, &props_ptr); @@ -359,7 +359,7 @@ void unpack_menu(bContext *C, } } - switch (checkPackedFile(BKE_main_blendfile_path(bmain), abs_name, pf)) { + switch (BKE_packedfile_compare_to_file(BKE_main_blendfile_path(bmain), abs_name, pf)) { case PF_NOFILE: BLI_snprintf(line, sizeof(line), TIP_("Create %s"), abs_name); // uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_WRITE_ORIGINAL); -- cgit v1.2.3