Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_file/filelist.c
| Show First 20 Lines • Show All 479 Lines • ▼ Show 20 Lines | static void filelist_readjob_main_assets(struct FileListReadJob *job_params, | ||||
| short *do_update, | short *do_update, | ||||
| float *progress); | float *progress); | ||||
| /* helper, could probably go in BKE actually? */ | /* helper, could probably go in BKE actually? */ | ||||
| static int groupname_to_code(const char *group); | static int groupname_to_code(const char *group); | ||||
| static uint64_t groupname_to_filter_id(const char *group); | static uint64_t groupname_to_filter_id(const char *group); | ||||
| static void filelist_cache_clear(FileListEntryCache *cache, size_t new_size); | static void filelist_cache_clear(FileListEntryCache *cache, size_t new_size); | ||||
| static bool filelist_intern_entry_is_main_file(const FileListInternEntry *intern_entry); | |||||
| /* ********** Sort helpers ********** */ | /* ********** Sort helpers ********** */ | ||||
| struct FileSortData { | struct FileSortData { | ||||
| bool inverted; | bool inverted; | ||||
| }; | }; | ||||
| static int compare_apply_inverted(int val, const struct FileSortData *sort_data) | static int compare_apply_inverted(int val, const struct FileSortData *sort_data) | ||||
| ▲ Show 20 Lines • Show All 524 Lines • ▼ Show 20 Lines | static bool is_filtered_lib_type(FileListInternEntry *file, | ||||
| return is_filtered_file_type(file, filter); | return is_filtered_file_type(file, filter); | ||||
| } | } | ||||
| static bool is_filtered_lib(FileListInternEntry *file, const char *root, FileListFilter *filter) | static bool is_filtered_lib(FileListInternEntry *file, const char *root, FileListFilter *filter) | ||||
| { | { | ||||
| return is_filtered_lib_type(file, root, filter) && is_filtered_file_relpath(file, filter); | return is_filtered_lib_type(file, root, filter) && is_filtered_file_relpath(file, filter); | ||||
| } | } | ||||
| static bool is_filtered_asset_library(FileListInternEntry *file, | |||||
| const char *root, | |||||
| FileListFilter *filter) | |||||
| { | |||||
| return is_filtered_lib_type(file, root, filter) && is_filtered_asset(file, filter); | |||||
| } | |||||
| static bool is_filtered_main(FileListInternEntry *file, | static bool is_filtered_main(FileListInternEntry *file, | ||||
| const char *UNUSED(dir), | const char *UNUSED(dir), | ||||
| FileListFilter *filter) | FileListFilter *filter) | ||||
| { | { | ||||
| return !is_filtered_hidden(file->relpath, filter, file); | return !is_filtered_hidden(file->relpath, filter, file); | ||||
| } | } | ||||
| static bool is_filtered_main_assets(FileListInternEntry *file, | static bool is_filtered_main_assets(FileListInternEntry *file, | ||||
| const char *UNUSED(dir), | const char *UNUSED(dir), | ||||
| FileListFilter *filter) | FileListFilter *filter) | ||||
| { | { | ||||
| /* "Filtered" means *not* being filtered out... So return true if the file should be visible. */ | /* "Filtered" means *not* being filtered out... So return true if the file should be visible. */ | ||||
| return is_filtered_id_file_type(file, file->relpath, file->name, filter) && | return is_filtered_id_file_type(file, file->relpath, file->name, filter) && | ||||
| is_filtered_asset(file, filter); | is_filtered_asset(file, filter); | ||||
| } | } | ||||
| static bool is_filtered_asset_library(FileListInternEntry *file, | |||||
| const char *root, | |||||
| FileListFilter *filter) | |||||
| { | |||||
| if (filelist_intern_entry_is_main_file(file)) { | |||||
| return is_filtered_main_assets(file, root, filter); | |||||
| } | |||||
| return is_filtered_lib_type(file, root, filter) && is_filtered_asset(file, filter); | |||||
| } | |||||
| void filelist_tag_needs_filtering(FileList *filelist) | void filelist_tag_needs_filtering(FileList *filelist) | ||||
| { | { | ||||
| filelist->flags |= FL_NEED_FILTERING; | filelist->flags |= FL_NEED_FILTERING; | ||||
| } | } | ||||
| void filelist_filter(FileList *filelist) | void filelist_filter(FileList *filelist) | ||||
| { | { | ||||
| int num_filtered = 0; | int num_filtered = 0; | ||||
| ▲ Show 20 Lines • Show All 3,058 Lines • Show Last 20 Lines | |||||