Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_file/filelist.c
| Show First 20 Lines • Show All 385 Lines • ▼ Show 20 Lines | |||||
| struct FileListReadJob; | struct FileListReadJob; | ||||
| typedef struct FileList { | typedef struct FileList { | ||||
| FileDirEntryArr filelist; | FileDirEntryArr filelist; | ||||
| eFileSelectType type; | eFileSelectType type; | ||||
| /* The library this list was created for. Stored here so we know when to re-read. */ | /* The library this list was created for. Stored here so we know when to re-read. */ | ||||
| AssetLibraryReference *asset_library_ref; | AssetLibraryReference *asset_library_ref; | ||||
| struct AssetLibrary *asset_library; | struct AssetLibrary *asset_library; /* Non-owning pointer. */ | ||||
| short flags; | short flags; | ||||
| short sort; | short sort; | ||||
| FileListFilter filter_data; | FileListFilter filter_data; | ||||
| struct FileListIntern filelist_intern; | struct FileListIntern filelist_intern; | ||||
| ▲ Show 20 Lines • Show All 1,439 Lines • ▼ Show 20 Lines | void filelist_clear_ex(struct FileList *filelist, | ||||
| filelist_direntryarr_free(&filelist->filelist); | filelist_direntryarr_free(&filelist->filelist); | ||||
| if (do_selection && filelist->selection_state) { | if (do_selection && filelist->selection_state) { | ||||
| BLI_ghash_clear(filelist->selection_state, NULL, NULL); | BLI_ghash_clear(filelist->selection_state, NULL, NULL); | ||||
| } | } | ||||
| if (do_asset_library && (filelist->asset_library != NULL)) { | if (do_asset_library && (filelist->asset_library != NULL)) { | ||||
| /* There is no way to refresh the catalogs stored by the AssetLibrary struct, so instead of | /* The AssetLibraryService owns the AssetLibrary pointer, so no need for us to free it. */ | ||||
| * "clearing" it, the entire struct is freed. It will be reallocated when needed. */ | |||||
| BKE_asset_library_free(filelist->asset_library); | |||||
| filelist->asset_library = NULL; | filelist->asset_library = NULL; | ||||
| } | } | ||||
| } | } | ||||
| void filelist_clear(struct FileList *filelist) | void filelist_clear(struct FileList *filelist) | ||||
| { | { | ||||
| filelist_clear_ex(filelist, true, true, true); | filelist_clear_ex(filelist, true, true, true); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,896 Lines • Show Last 20 Lines | |||||