diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-17 17:13:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-17 17:13:24 +0300 |
commit | a0a1fc89387f0f1396b5e4320c2dd4a6fedd1c25 (patch) | |
tree | bc5afe62e3b23d19cf5dbe21ee9e87839a88827d /source/blender/editors | |
parent | 6453814ec033feb4549a9d565efc4ac968b2ac13 (diff) |
Cleanup: BLI path extension API
Use BLI_path_extension_* prefix.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 2 | ||||
-rw-r--r-- | source/blender/editors/io/io_alembic.c | 6 | ||||
-rw-r--r-- | source/blender/editors/io/io_cache.c | 2 | ||||
-rw-r--r-- | source/blender/editors/io/io_collada.c | 8 | ||||
-rw-r--r-- | source/blender/editors/screen/screendump.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sound/sound_ops.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 24 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 4 |
9 files changed, 28 insertions, 28 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 0315bf736f0..a04ca799658 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -612,7 +612,7 @@ static void init_iconfile_list(struct ListBase *list) if ((dir[i].type & S_IFREG)) { const char *filename = dir[i].relname; - if (BLI_testextensie(filename, ".png")) { + if (BLI_path_extension_check(filename, ".png")) { /* loading all icons on file start is overkill & slows startup * its possible they change size after blender load anyway. */ #if 0 diff --git a/source/blender/editors/io/io_alembic.c b/source/blender/editors/io/io_alembic.c index 671857443d2..9131243b926 100644 --- a/source/blender/editors/io/io_alembic.c +++ b/source/blender/editors/io/io_alembic.c @@ -86,7 +86,7 @@ static int wm_alembic_export_invoke(bContext *C, wmOperator *op, const wmEvent * BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath)); } - BLI_replace_extension(filepath, sizeof(filepath), ".abc"); + BLI_path_extension_replace(filepath, sizeof(filepath), ".abc"); RNA_string_set(op->ptr, "filepath", filepath); } @@ -284,8 +284,8 @@ static bool wm_alembic_export_check(bContext *UNUSED(C), wmOperator *op) char filepath[FILE_MAX]; RNA_string_get(op->ptr, "filepath", filepath); - if (!BLI_testextensie(filepath, ".abc")) { - BLI_ensure_extension(filepath, FILE_MAX, ".abc"); + if (!BLI_path_extension_check(filepath, ".abc")) { + BLI_path_extension_ensure(filepath, FILE_MAX, ".abc"); RNA_string_set(op->ptr, "filepath", filepath); return true; } diff --git a/source/blender/editors/io/io_cache.c b/source/blender/editors/io/io_cache.c index b13eaced843..221142a6cf8 100644 --- a/source/blender/editors/io/io_cache.c +++ b/source/blender/editors/io/io_cache.c @@ -61,7 +61,7 @@ static int cachefile_open_invoke(bContext *C, wmOperator *op, const wmEvent *eve Main *bmain = CTX_data_main(C); BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath)); - BLI_replace_extension(filepath, sizeof(filepath), ".abc"); + BLI_path_extension_replace(filepath, sizeof(filepath), ".abc"); RNA_string_set(op->ptr, "filepath", filepath); } diff --git a/source/blender/editors/io/io_collada.c b/source/blender/editors/io/io_collada.c index 30323d421de..76ddd221ea4 100644 --- a/source/blender/editors/io/io_collada.c +++ b/source/blender/editors/io/io_collada.c @@ -71,7 +71,7 @@ static int wm_collada_export_invoke(bContext *C, wmOperator *op, const wmEvent * else BLI_strncpy(filepath, blendfile_path, sizeof(filepath)); - BLI_replace_extension(filepath, sizeof(filepath), ".dae"); + BLI_path_extension_replace(filepath, sizeof(filepath), ".dae"); RNA_string_set(op->ptr, "filepath", filepath); } @@ -118,7 +118,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op) } RNA_string_get(op->ptr, "filepath", filepath); - BLI_ensure_extension(filepath, sizeof(filepath), ".dae"); + BLI_path_extension_ensure(filepath, sizeof(filepath), ".dae"); /* Avoid File write exceptions in Collada */ @@ -336,8 +336,8 @@ static bool wm_collada_export_check(bContext *UNUSED(C), wmOperator *op) char filepath[FILE_MAX]; RNA_string_get(op->ptr, "filepath", filepath); - if (!BLI_testextensie(filepath, ".dae")) { - BLI_ensure_extension(filepath, FILE_MAX, ".dae"); + if (!BLI_path_extension_check(filepath, ".dae")) { + BLI_path_extension_ensure(filepath, FILE_MAX, ".dae"); RNA_string_set(op->ptr, "filepath", filepath); return true; } diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index ec01aceeb6c..54ff3d51479 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -232,7 +232,7 @@ static int screenshot_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED( char filepath[FILE_MAX] = "//screen"; if (G.relbase_valid) { BLI_strncpy(filepath, BKE_main_blendfile_path_from_global(), sizeof(filepath)); - BLI_replace_extension(filepath, sizeof(filepath), ""); /* strip '.blend' */ + BLI_path_extension_replace(filepath, sizeof(filepath), ""); /* strip '.blend' */ } RNA_string_set(op->ptr, "filepath", filepath); diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index ad8469a7c6a..b91ac3ce1ae 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -454,10 +454,10 @@ static bool sound_mixdown_check(bContext *UNUSED(C), wmOperator *op) prop = RNA_struct_find_property(op->ptr, "filepath"); RNA_property_string_get(op->ptr, prop, filepath); - if (BLI_testextensie_array(filepath, snd_ext_sound)) - check = BLI_replace_extension(filepath, FILE_MAX, extension); + if (BLI_path_extension_check_array(filepath, snd_ext_sound)) + check = BLI_path_extension_replace(filepath, FILE_MAX, extension); else - check = BLI_ensure_extension(filepath, FILE_MAX, extension); + check = BLI_path_extension_ensure(filepath, FILE_MAX, extension); if (!check) return check; diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 8123bed541c..658725879cb 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -1973,31 +1973,31 @@ int ED_path_extension_type(const char *path) else if (file_is_blend_backup(path)) { return FILE_TYPE_BLENDER_BACKUP; } - else if (BLI_testextensie(path, ".app")) { + else if (BLI_path_extension_check(path, ".app")) { return FILE_TYPE_APPLICATIONBUNDLE; } - else if (BLI_testextensie(path, ".py")) { + else if (BLI_path_extension_check(path, ".py")) { return FILE_TYPE_PYSCRIPT; } - else if (BLI_testextensie_n(path, ".txt", ".glsl", ".osl", ".data", ".pov", ".ini", ".mcr", ".inc", NULL)) { + else if (BLI_path_extension_check_n(path, ".txt", ".glsl", ".osl", ".data", ".pov", ".ini", ".mcr", ".inc", NULL)) { return FILE_TYPE_TEXT; } - else if (BLI_testextensie_n(path, ".ttf", ".ttc", ".pfb", ".otf", ".otc", NULL)) { + else if (BLI_path_extension_check_n(path, ".ttf", ".ttc", ".pfb", ".otf", ".otc", NULL)) { return FILE_TYPE_FTFONT; } - else if (BLI_testextensie(path, ".btx")) { + else if (BLI_path_extension_check(path, ".btx")) { return FILE_TYPE_BTX; } - else if (BLI_testextensie(path, ".dae")) { + else if (BLI_path_extension_check(path, ".dae")) { return FILE_TYPE_COLLADA; } - else if (BLI_testextensie(path, ".abc")) { + else if (BLI_path_extension_check(path, ".abc")) { return FILE_TYPE_ALEMBIC; } - else if (BLI_testextensie_array(path, imb_ext_image)) { + else if (BLI_path_extension_check_array(path, imb_ext_image)) { return FILE_TYPE_IMAGE; } - else if (BLI_testextensie(path, ".ogg")) { + else if (BLI_path_extension_check(path, ".ogg")) { if (IMB_isanim(path)) { return FILE_TYPE_MOVIE; } @@ -2005,10 +2005,10 @@ int ED_path_extension_type(const char *path) return FILE_TYPE_SOUND; } } - else if (BLI_testextensie_array(path, imb_ext_movie)) { + else if (BLI_path_extension_check_array(path, imb_ext_movie)) { return FILE_TYPE_MOVIE; } - else if (BLI_testextensie_array(path, imb_ext_audio)) { + else if (BLI_path_extension_check_array(path, imb_ext_audio)) { return FILE_TYPE_SOUND; } return 0; @@ -2233,7 +2233,7 @@ static int filelist_readjob_list_dir( /* Otherwise, do not check extensions for directories! */ else if (!(entry->typeflag & FILE_TYPE_DIR)) { entry->typeflag = file_extension_type(root, entry->relpath); - if (filter_glob[0] && BLI_testextensie_glob(entry->relpath, filter_glob)) { + if (filter_glob[0] && BLI_path_extension_check_glob(entry->relpath, filter_glob)) { entry->typeflag |= FILE_TYPE_OPERATOR; } } diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 2ce7da2126c..a441dedc57a 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1532,7 +1532,7 @@ static int image_replace_exec(bContext *C, wmOperator *op) BKE_image_signal(bmain, sima->image, &sima->iuser, IMA_SIGNAL_SRC_CHANGE); } - if (BLI_testextensie_array(str, imb_ext_movie)) + if (BLI_path_extension_check_array(str, imb_ext_movie)) sima->image->source = IMA_SRC_MOVIE; else sima->image->source = IMA_SRC_FILE; diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index e93a18449b0..d672bbcc532 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -3894,7 +3894,7 @@ static int sequencer_export_subtitles_invoke(bContext *C, wmOperator *op, const else BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath)); - BLI_replace_extension(filepath, sizeof(filepath), ".srt"); + BLI_path_extension_replace(filepath, sizeof(filepath), ".srt"); RNA_string_set(op->ptr, "filepath", filepath); } @@ -3919,7 +3919,7 @@ static int sequencer_export_subtitles_exec(bContext *C, wmOperator *op) } RNA_string_get(op->ptr, "filepath", filepath); - BLI_ensure_extension(filepath, sizeof(filepath), ".srt"); + BLI_path_extension_ensure(filepath, sizeof(filepath), ".srt"); /* Avoid File write exceptions */ if (!BLI_exists(filepath)) { |