diff options
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/io/io_cache.c | 18 | ||||
-rw-r--r-- | source/blender/editors/render/render_preview.cc | 24 | ||||
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 20 | ||||
-rw-r--r-- | source/blender/editors/space_file/fsmenu.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_file/fsmenu.h | 4 | ||||
-rw-r--r-- | source/blender/editors/util/ed_util_ops.cc | 10 |
6 files changed, 42 insertions, 42 deletions
diff --git a/source/blender/editors/io/io_cache.c b/source/blender/editors/io/io_cache.c index 624b85358f5..969049313c9 100644 --- a/source/blender/editors/io/io_cache.c +++ b/source/blender/editors/io/io_cache.c @@ -75,17 +75,17 @@ static void open_cancel(bContext *UNUSED(C), wmOperator *op) static int cachefile_open_exec(bContext *C, wmOperator *op) { if (!RNA_struct_property_is_set(op->ptr, "filepath")) { - BKE_report(op->reports, RPT_ERROR, "No filename given"); + BKE_report(op->reports, RPT_ERROR, "No filepath given"); return OPERATOR_CANCELLED; } - char filename[FILE_MAX]; - RNA_string_get(op->ptr, "filepath", filename); + char filepath[FILE_MAX]; + RNA_string_get(op->ptr, "filepath", filepath); Main *bmain = CTX_data_main(C); - CacheFile *cache_file = BKE_libblock_alloc(bmain, ID_CF, BLI_path_basename(filename), 0); - BLI_strncpy(cache_file->filepath, filename, FILE_MAX); + CacheFile *cache_file = BKE_libblock_alloc(bmain, ID_CF, BLI_path_basename(filepath), 0); + BLI_strncpy(cache_file->filepath, filepath, FILE_MAX); DEG_id_tag_update(&cache_file->id, ID_RECALC_COPY_ON_WRITE); /* Will be set when running invoke, not exec directly. */ @@ -182,7 +182,7 @@ static int cachefile_layer_open_invoke(bContext *C, wmOperator *op, const wmEven static int cachefile_layer_add_exec(bContext *C, wmOperator *op) { if (!RNA_struct_property_is_set(op->ptr, "filepath")) { - BKE_report(op->reports, RPT_ERROR, "No filename given"); + BKE_report(op->reports, RPT_ERROR, "No filepath given"); return OPERATOR_CANCELLED; } @@ -192,10 +192,10 @@ static int cachefile_layer_add_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - char filename[FILE_MAX]; - RNA_string_get(op->ptr, "filepath", filename); + char filepath[FILE_MAX]; + RNA_string_get(op->ptr, "filepath", filepath); - CacheFileLayer *layer = BKE_cachefile_add_layer(cache_file, filename); + CacheFileLayer *layer = BKE_cachefile_add_layer(cache_file, filepath); if (!layer) { WM_report(RPT_ERROR, "Could not add a layer to the cache file"); diff --git a/source/blender/editors/render/render_preview.cc b/source/blender/editors/render/render_preview.cc index a56f513e98f..addcedc4481 100644 --- a/source/blender/editors/render/render_preview.cc +++ b/source/blender/editors/render/render_preview.cc @@ -1306,7 +1306,7 @@ static ImBuf *icon_preview_imbuf_from_brush(Brush *brush) { static const int flags = IB_rect | IB_multilayer | IB_metadata; - char path[FILE_MAX]; + char filepath[FILE_MAX]; const char *folder; if (!(brush->icon_imbuf)) { @@ -1315,22 +1315,22 @@ static ImBuf *icon_preview_imbuf_from_brush(Brush *brush) if (brush->icon_filepath[0]) { /* First use the path directly to try and load the file. */ - BLI_strncpy(path, brush->icon_filepath, sizeof(brush->icon_filepath)); - BLI_path_abs(path, ID_BLEND_PATH_FROM_GLOBAL(&brush->id)); + BLI_strncpy(filepath, brush->icon_filepath, sizeof(brush->icon_filepath)); + BLI_path_abs(filepath, ID_BLEND_PATH_FROM_GLOBAL(&brush->id)); /* Use default color-spaces for brushes. */ - brush->icon_imbuf = IMB_loadiffname(path, flags, nullptr); + brush->icon_imbuf = IMB_loadiffname(filepath, flags, nullptr); /* otherwise lets try to find it in other directories */ if (!(brush->icon_imbuf)) { folder = BKE_appdir_folder_id(BLENDER_DATAFILES, "brushicons"); BLI_make_file_string( - BKE_main_blendfile_path_from_global(), path, folder, brush->icon_filepath); + BKE_main_blendfile_path_from_global(), filepath, folder, brush->icon_filepath); - if (path[0]) { + if (filepath[0]) { /* Use default color spaces. */ - brush->icon_imbuf = IMB_loadiffname(path, flags, nullptr); + brush->icon_imbuf = IMB_loadiffname(filepath, flags, nullptr); } } @@ -1821,13 +1821,13 @@ void PreviewLoadJob::run_fn(void *customdata, const char *deferred_data = static_cast<char *>(PRV_DEFERRED_DATA(preview)); const ThumbSource source = static_cast<ThumbSource>(deferred_data[0]); - const char *path = &deferred_data[1]; + const char *filepath = &deferred_data[1]; - // printf("loading deferred %d×%d preview for %s\n", request->sizex, request->sizey, path); + // printf("loading deferred %d×%d preview for %s\n", request->sizex, request->sizey, filepath); - IMB_thumb_path_lock(path); - ImBuf *thumb = IMB_thumb_manage(path, THB_LARGE, source); - IMB_thumb_path_unlock(path); + IMB_thumb_path_lock(filepath); + ImBuf *thumb = IMB_thumb_manage(filepath, THB_LARGE, source); + IMB_thumb_path_unlock(filepath); if (thumb) { /* PreviewImage assumes premultiplied alpha... */ diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 59ecef7d4c6..cfbbc1a1b45 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -336,7 +336,7 @@ enum { }; typedef struct FileListEntryPreview { - char path[FILE_MAX]; + char filepath[FILE_MAX]; uint flags; int index; int attributes; /* from FileDirEntry. */ @@ -1636,13 +1636,13 @@ static void filelist_cache_preview_runf(TaskPool *__restrict pool, void *taskdat source = THB_SOURCE_FONT; } - IMB_thumb_path_lock(preview->path); + IMB_thumb_path_lock(preview->filepath); /* Always generate biggest preview size for now, it's simpler and avoids having to re-generate * in case user switch to a bigger preview size. Do not create preview when file is offline. */ ImBuf *imbuf = (preview->attributes & FILE_ATTR_OFFLINE) ? - IMB_thumb_read(preview->path, THB_LARGE) : - IMB_thumb_manage(preview->path, THB_LARGE, source); - IMB_thumb_path_unlock(preview->path); + IMB_thumb_read(preview->filepath, THB_LARGE) : + IMB_thumb_manage(preview->filepath, THB_LARGE, source); + IMB_thumb_path_unlock(preview->filepath); if (imbuf) { preview->icon_id = BKE_icon_imbuf_create(imbuf); } @@ -1753,7 +1753,7 @@ static void filelist_cache_previews_push(FileList *filelist, FileDirEntry *entry if (preview_in_memory) { /* TODO(mano-wii): No need to use the thread API here. */ BLI_assert(BKE_previewimg_is_finished(preview_in_memory, ICON_SIZE_PREVIEW)); - preview->path[0] = '\0'; + preview->filepath[0] = '\0'; ImBuf *imbuf = BKE_previewimg_to_imbuf(preview_in_memory, ICON_SIZE_PREVIEW); if (imbuf) { preview->icon_id = BKE_icon_imbuf_create(imbuf); @@ -1762,13 +1762,13 @@ static void filelist_cache_previews_push(FileList *filelist, FileDirEntry *entry } else { if (entry->redirection_path) { - BLI_strncpy(preview->path, entry->redirection_path, FILE_MAXDIR); + BLI_strncpy(preview->filepath, entry->redirection_path, FILE_MAXDIR); } else { BLI_join_dirfile( - preview->path, sizeof(preview->path), filelist->filelist.root, entry->relpath); + preview->filepath, sizeof(preview->filepath), filelist->filelist.root, entry->relpath); } - // printf("%s: %d - %s\n", __func__, preview->index, preview->path); + // printf("%s: %d - %s\n", __func__, preview->index, preview->filepath); FileListEntryPreviewTaskData *preview_taskdata = MEM_mallocN(sizeof(*preview_taskdata), __func__); @@ -2667,7 +2667,7 @@ bool filelist_cache_previews_update(FileList *filelist) * we do not want to cache it again here. */ entry = filelist_file_ex(filelist, preview->index, false); - // printf("%s: %d - %s - %p\n", __func__, preview->index, preview->path, preview->img); + // printf("%s: %d - %s - %p\n", __func__, preview->index, preview->filepath, preview->img); if (entry) { if (preview->icon_id) { diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 65354591034..10cde239987 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -519,13 +519,13 @@ void fsmenu_remove_entry(struct FSMenu *fsmenu, FSMenuCategory category, int idx } } -void fsmenu_write_file(struct FSMenu *fsmenu, const char *filename) +void fsmenu_write_file(struct FSMenu *fsmenu, const char *filepath) { FSMenuEntry *fsm_iter = NULL; char fsm_name[FILE_MAX]; int nwritten = 0; - FILE *fp = BLI_fopen(filename, "w"); + FILE *fp = BLI_fopen(filepath, "w"); if (!fp) { return; } @@ -556,14 +556,14 @@ void fsmenu_write_file(struct FSMenu *fsmenu, const char *filename) fclose(fp); } -void fsmenu_read_bookmarks(struct FSMenu *fsmenu, const char *filename) +void fsmenu_read_bookmarks(struct FSMenu *fsmenu, const char *filepath) { char line[FILE_MAXDIR]; char name[FILE_MAXFILE]; FSMenuCategory category = FS_CATEGORY_BOOKMARKS; FILE *fp; - fp = BLI_fopen(filename, "r"); + fp = BLI_fopen(filepath, "r"); if (!fp) { return; } diff --git a/source/blender/editors/space_file/fsmenu.h b/source/blender/editors/space_file/fsmenu.h index 861c37ecaa1..6e980a326fc 100644 --- a/source/blender/editors/space_file/fsmenu.h +++ b/source/blender/editors/space_file/fsmenu.h @@ -38,10 +38,10 @@ short fsmenu_can_save(struct FSMenu *fsmenu, enum FSMenuCategory category, int i void fsmenu_remove_entry(struct FSMenu *fsmenu, enum FSMenuCategory category, int idx); /** saves the 'bookmarks' to the specified file */ -void fsmenu_write_file(struct FSMenu *fsmenu, const char *filename); +void fsmenu_write_file(struct FSMenu *fsmenu, const char *filepath); /** reads the 'bookmarks' from the specified file */ -void fsmenu_read_bookmarks(struct FSMenu *fsmenu, const char *filename); +void fsmenu_read_bookmarks(struct FSMenu *fsmenu, const char *filepath); /** adds system specific directories */ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks); diff --git a/source/blender/editors/util/ed_util_ops.cc b/source/blender/editors/util/ed_util_ops.cc index 803e65590a0..af3589e50f0 100644 --- a/source/blender/editors/util/ed_util_ops.cc +++ b/source/blender/editors/util/ed_util_ops.cc @@ -67,19 +67,19 @@ static bool lib_id_preview_editing_poll(bContext *C) static int lib_id_load_custom_preview_exec(bContext *C, wmOperator *op) { - char path[FILE_MAX]; + char filepath[FILE_MAX]; - RNA_string_get(op->ptr, "filepath", path); + RNA_string_get(op->ptr, "filepath", filepath); - if (!BLI_is_file(path)) { - BKE_reportf(op->reports, RPT_ERROR, "File not found '%s'", path); + if (!BLI_is_file(filepath)) { + BKE_reportf(op->reports, RPT_ERROR, "File not found '%s'", filepath); return OPERATOR_CANCELLED; } PointerRNA idptr = CTX_data_pointer_get(C, "id"); ID *id = (ID *)idptr.data; - BKE_previewimg_id_custom_set(id, path); + BKE_previewimg_id_custom_set(id, filepath); WM_event_add_notifier(C, NC_ASSET | NA_EDITED, nullptr); |