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:
authorSybren A. Stüvel <sybren@blender.org>2021-08-06 16:18:18 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-08-06 16:20:39 +0300
commit9cff9f9f5df034ca27848875c25471dd952c34c4 (patch)
treedbee329e85d8dd332a11bf905c43c2970c576a0c /source/blender/editors/space_file
parent2796ee7da049bbea3d83efdd42c3eaf1af1ebb2c (diff)
Cleanup: rename `FileList::asset_library` → `asset_library_ref`
In the `FileList` struct, rename the `AssetLibraryReference *asset_library` field to `asset_library_ref` -- it's a description of which asset library is used, and not the asset library itself. This is to make space for a future `AssetLibrary *asset_library` field, which will point to an actual asset library struct/class. No functional changes. Reviewed by: Severin Differential Revision: https://developer.blender.org/D12151
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r--source/blender/editors/space_file/file_draw.c2
-rw-r--r--source/blender/editors/space_file/filelist.c30
-rw-r--r--source/blender/editors/space_file/filelist.h2
-rw-r--r--source/blender/editors/space_file/filesel.c6
-rw-r--r--source/blender/editors/space_file/space_file.c8
5 files changed, 24 insertions, 24 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 7d9b8583838..9a46579780e 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -1106,7 +1106,7 @@ bool file_draw_hint_if_invalid(const SpaceFile *sfile, const ARegion *region)
return false;
}
/* Check if the library exists. */
- if ((asset_params->asset_library.type == ASSET_LIBRARY_LOCAL) ||
+ if ((asset_params->asset_library_ref.type == ASSET_LIBRARY_LOCAL) ||
filelist_is_dir(sfile->files, asset_params->base_params.dir)) {
return false;
}
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 630c9aed157..4eb58642bba 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -384,7 +384,7 @@ typedef struct FileList {
eFileSelectType type;
/* The library this list was created for. Stored here so we know when to re-read. */
- AssetLibraryReference *asset_library;
+ AssetLibraryReference *asset_library_ref;
short flags;
@@ -1065,28 +1065,28 @@ static bool filelist_compare_asset_libraries(const AssetLibraryReference *librar
}
/**
- * \param asset_library: May be NULL to unset the library.
+ * \param asset_library_ref: May be NULL to unset the library.
*/
-void filelist_setlibrary(FileList *filelist, const AssetLibraryReference *asset_library)
+void filelist_setlibrary(FileList *filelist, const AssetLibraryReference *asset_library_ref)
{
/* Unset if needed. */
- if (!asset_library) {
- if (filelist->asset_library) {
- MEM_SAFE_FREE(filelist->asset_library);
+ if (!asset_library_ref) {
+ if (filelist->asset_library_ref) {
+ MEM_SAFE_FREE(filelist->asset_library_ref);
filelist->flags |= FL_FORCE_RESET;
}
return;
}
- if (!filelist->asset_library) {
- filelist->asset_library = MEM_mallocN(sizeof(*filelist->asset_library),
- "filelist asset library");
- *filelist->asset_library = *asset_library;
+ if (!filelist->asset_library_ref) {
+ filelist->asset_library_ref = MEM_mallocN(sizeof(*filelist->asset_library_ref),
+ "filelist asset library");
+ *filelist->asset_library_ref = *asset_library_ref;
filelist->flags |= FL_FORCE_RESET;
}
- else if (!filelist_compare_asset_libraries(filelist->asset_library, asset_library)) {
- *filelist->asset_library = *asset_library;
+ else if (!filelist_compare_asset_libraries(filelist->asset_library_ref, asset_library_ref)) {
+ *filelist->asset_library_ref = *asset_library_ref;
filelist->flags |= FL_FORCE_RESET;
}
}
@@ -1791,7 +1791,7 @@ void filelist_free(struct FileList *filelist)
filelist->selection_state = NULL;
}
- MEM_SAFE_FREE(filelist->asset_library);
+ MEM_SAFE_FREE(filelist->asset_library_ref);
memset(&filelist->filter_data, 0, sizeof(filelist->filter_data));
@@ -1867,7 +1867,7 @@ bool filelist_is_dir(struct FileList *filelist, const char *path)
*/
void filelist_setdir(struct FileList *filelist, char *r_dir)
{
- const bool allow_invalid = filelist->asset_library != NULL;
+ const bool allow_invalid = filelist->asset_library_ref != NULL;
BLI_assert(strlen(r_dir) < FILE_MAX_LIBEXTRA);
BLI_path_normalize_dir(BKE_main_blendfile_path_from_global(), r_dir);
@@ -3381,7 +3381,7 @@ static void filelist_readjob_startjob(void *flrjv, short *stop, short *do_update
flrj->tmp_filelist->libfiledata = NULL;
memset(&flrj->tmp_filelist->filelist_cache, 0, sizeof(flrj->tmp_filelist->filelist_cache));
flrj->tmp_filelist->selection_state = NULL;
- flrj->tmp_filelist->asset_library = NULL;
+ flrj->tmp_filelist->asset_library_ref = NULL;
BLI_mutex_unlock(&flrj->lock);
diff --git a/source/blender/editors/space_file/filelist.h b/source/blender/editors/space_file/filelist.h
index 6915e853681..d67cd89200b 100644
--- a/source/blender/editors/space_file/filelist.h
+++ b/source/blender/editors/space_file/filelist.h
@@ -73,7 +73,7 @@ void filelist_setfilter_options(struct FileList *filelist,
const char *filter_search);
void filelist_filter(struct FileList *filelist);
void filelist_setlibrary(struct FileList *filelist,
- const struct AssetLibraryReference *asset_library);
+ const struct AssetLibraryReference *asset_library_ref);
void filelist_init_icons(void);
void filelist_free_icons(void);
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index 89142b6669b..72e7e0716db 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -118,8 +118,8 @@ static void fileselect_ensure_updated_asset_params(SpaceFile *sfile)
asset_params = sfile->asset_params = MEM_callocN(sizeof(*asset_params),
"FileAssetSelectParams");
asset_params->base_params.details_flags = U_default.file_space_data.details_flags;
- asset_params->asset_library.type = ASSET_LIBRARY_LOCAL;
- asset_params->asset_library.custom_library_index = -1;
+ asset_params->asset_library_ref.type = ASSET_LIBRARY_LOCAL;
+ asset_params->asset_library_ref.custom_library_index = -1;
asset_params->import_type = FILE_ASSET_IMPORT_APPEND;
}
@@ -415,7 +415,7 @@ FileAssetSelectParams *ED_fileselect_get_asset_params(const SpaceFile *sfile)
static void fileselect_refresh_asset_params(FileAssetSelectParams *asset_params)
{
- AssetLibraryReference *library = &asset_params->asset_library;
+ AssetLibraryReference *library = &asset_params->asset_library_ref;
FileSelectParams *base_params = &asset_params->base_params;
bUserAssetLibrary *user_library = NULL;
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index 756fc179e31..0b3349f5751 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -338,7 +338,7 @@ static void file_refresh(const bContext *C, ScrArea *area)
filelist_setdir(sfile->files, params->dir);
filelist_setrecursion(sfile->files, params->recursion_level);
filelist_setsorting(sfile->files, params->sort, params->flag & FILE_SORT_INVERT);
- filelist_setlibrary(sfile->files, asset_params ? &asset_params->asset_library : NULL);
+ filelist_setlibrary(sfile->files, asset_params ? &asset_params->asset_library_ref : NULL);
filelist_setfilter_options(
sfile->files,
(params->flag & FILE_FILTER) != 0,
@@ -863,7 +863,7 @@ static void file_space_subtype_item_extend(bContext *UNUSED(C),
static const char *file_context_dir[] = {
"active_file",
- "asset_library",
+ "asset_library_ref",
"id",
NULL,
};
@@ -897,14 +897,14 @@ static int /*eContextResult*/ file_context(const bContext *C,
CTX_data_pointer_set(result, &screen->id, &RNA_FileSelectEntry, file);
return CTX_RESULT_OK;
}
- if (CTX_data_equals(member, "asset_library")) {
+ if (CTX_data_equals(member, "asset_library_ref")) {
FileAssetSelectParams *asset_params = ED_fileselect_get_asset_params(sfile);
if (!asset_params) {
return CTX_RESULT_NO_DATA;
}
CTX_data_pointer_set(
- result, &screen->id, &RNA_AssetLibraryReference, &asset_params->asset_library);
+ result, &screen->id, &RNA_AssetLibraryReference, &asset_params->asset_library_ref);
return CTX_RESULT_OK;
}
if (CTX_data_equals(member, "id")) {