|
Blender V5.0
|
#include "AS_asset_catalog.hh"#include "AS_asset_library.hh"#include "AS_asset_representation.hh"#include "BLI_listbase.h"#include "BLI_path_utils.hh"#include "BLI_string.h"#include "../filelist.hh"#include "filelist_intern.hh"Go to the source code of this file.
Classes | |
| struct | FileSortData |
Functions | |
| static int | compare_apply_inverted (int val, const FileSortData *sort_data) |
| static int | compare_tiebreaker (const FileListInternEntry *entry1, const FileListInternEntry *entry2) |
| static int | compare_direntry_generic (const FileListInternEntry *entry1, const FileListInternEntry *entry2) |
| static int | compare_name (void *user_data, const void *a1, const void *a2) |
| static int | compare_date (void *user_data, const void *a1, const void *a2) |
| static int | compare_size (void *user_data, const void *a1, const void *a2) |
| static int | compare_extension (void *user_data, const void *a1, const void *a2) |
| static int | compare_asset_catalog (void *user_data, const void *a1, const void *a2) |
| void | filelist_sort (FileList *filelist) |
| void | filelist_setsorting (FileList *filelist, const short sort, bool invert_sort) |
|
static |
Definition at line 24 of file filelist_sort.cc.
References FileSortData::inverted.
Referenced by compare_asset_catalog(), compare_date(), compare_extension(), compare_name(), and compare_size().
|
static |
Definition at line 248 of file filelist_sort.cc.
References BLI_strcasecmp_natural(), blender::asset_system::AssetCatalogPath::c_str(), blender::StringRefNull::c_str(), AssetMetaData::catalog_id, blender::asset_system::AssetLibrary::catalog_service(), compare_apply_inverted(), compare_direntry_generic(), compare_tiebreaker(), blender::asset_system::AssetCatalogService::find_catalog(), FileListInternEntry::get_asset(), blender::asset_system::AssetRepresentation::get_metadata(), blender::asset_system::AssetLibrary::name(), blender::asset_system::AssetRepresentation::owner_asset_library(), and blender::asset_system::AssetCatalog::path.
Referenced by filelist_sort().
|
static |
Definition at line 145 of file filelist_sort.cc.
References compare_apply_inverted(), compare_direntry_generic(), compare_tiebreaker(), ret, and FileListInternEntry::st.
Referenced by filelist_sort().
|
static |
Handles inverted sorting itself (currently there's nothing to invert), so if this returns non-0, it should be used as-is and not inverted.
Definition at line 80 of file filelist_sort.cc.
References FILE_TYPE_BLENDER, FILE_TYPE_BLENDER_BACKUP, FILE_TYPE_BLENDERLIB, FILE_TYPE_DIR, FILENAME_IS_CURRENT, FILENAME_IS_PARENT, FileListInternEntry::relpath, and FileListInternEntry::typeflag.
Referenced by compare_asset_catalog(), compare_date(), compare_extension(), compare_name(), and compare_size().
|
static |
Definition at line 193 of file filelist_sort.cc.
References FileListInternEntry::blentype, BLI_strcasecmp(), compare_apply_inverted(), compare_direntry_generic(), compare_tiebreaker(), FILE_TYPE_BLENDERLIB, FILE_TYPE_DIR, FileListInternEntry::relpath, ret, and FileListInternEntry::typeflag.
Referenced by filelist_sort().
|
static |
Definition at line 131 of file filelist_sort.cc.
References compare_apply_inverted(), compare_direntry_generic(), compare_tiebreaker(), and ret.
Referenced by filelist_sort(), and MEM_guarded_printmemlist_stats().
|
static |
Definition at line 169 of file filelist_sort.cc.
References compare_apply_inverted(), compare_direntry_generic(), compare_tiebreaker(), ret, and FileListInternEntry::st.
Referenced by filelist_sort(), and blender::gpu::MTLBufferHandle::MTLBufferHandle().
|
static |
If all relevant characteristics match (e.g. the file type when sorting by file types), this should be used as tiebreaker. It makes sure there's a well defined sorting even in such cases.
Multiple files with the same name can appear with recursive file loading and/or when displaying IDs of different types, so these cases need to be handled.
1) Sort files by name using natural sorting. 2) If not possible (file names match) and both represent local IDs, sort by ID-type. 3) If not possible and only one is a local ID, place files representing local IDs first.
TODO: (not actually implemented, but should be): 4) If no file represents a local ID, sort by file path, so that files higher up the file system hierarchy are placed first.
Definition at line 44 of file filelist_sort.cc.
References FileListInternEntry::blentype, BLI_strcasecmp_natural(), FileListInternEntry::id, FileListInternEntry::local_data, and FileListInternEntry::name.
Referenced by compare_asset_catalog(), compare_date(), compare_extension(), compare_name(), and compare_size().
| void filelist_setsorting | ( | FileList * | filelist, |
| const short | sort, | ||
| bool | invert_sort ) |
Definition at line 342 of file filelist_sort.cc.
References FL_NEED_SORTING, FL_SORT_INVERT, FileList::flags, FileList::sort, and sort().
Referenced by file_refresh(), and blender::ed::asset::list::AssetList::setup().
| void filelist_sort | ( | FileList * | filelist | ) |
Definition at line 306 of file filelist_sort.cc.
References BLI_assert, BLI_listbase_sort_r(), compare_asset_catalog(), compare_date(), compare_extension(), compare_name(), compare_size(), FileListIntern::entries, FILE_SORT_ALPHA, FILE_SORT_ASSET_CATALOG, FILE_SORT_DEFAULT, FILE_SORT_EXTENSION, FILE_SORT_SIZE, FILE_SORT_TIME, FileList::filelist_intern, filelist_tag_needs_filtering(), FL_NEED_SORTING, FL_SORT_INVERT, FileList::flags, FileSortData::inverted, and FileList::sort.
Referenced by blender::ed::asset::list::AssetList::ensure_blocking(), blender::ed::asset::list::AssetList::fetch(), file_refresh(), and filelist_files_ensure().