Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_file/filelist.c
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| /* There are no previews. */ | /* There are no previews. */ | ||||
| return false; | return false; | ||||
| } | } | ||||
| return (cache->previews_pool == NULL) || (cache->previews_done == NULL) || | return (cache->previews_pool == NULL) || (cache->previews_done == NULL) || | ||||
| (cache->previews_todo_count == (size_t)BLI_thread_queue_len(cache->previews_done)); | (cache->previews_todo_count == (size_t)BLI_thread_queue_len(cache->previews_done)); | ||||
| } | } | ||||
| /* would recognize .blend as well */ | |||||
| static bool file_is_blend_backup(const char *str) | |||||
| { | |||||
| const size_t a = strlen(str); | |||||
| size_t b = 7; | |||||
| bool retval = 0; | |||||
| if (a == 0 || b >= a) { | |||||
| /* pass */ | |||||
| } | |||||
| else { | |||||
| const char *loc; | |||||
| if (a > b + 1) { | |||||
| b++; | |||||
| } | |||||
| /* allow .blend1 .blend2 .blend32 */ | |||||
| loc = BLI_strcasestr(str + a - b, ".blend"); | |||||
| if (loc) { | |||||
| retval = 1; | |||||
| } | |||||
| } | |||||
| return retval; | |||||
| } | |||||
| /* TODO: Maybe we should move this to BLI? | /* TODO: Maybe we should move this to BLI? | ||||
| * On the other hand, it's using defines from space-file area, so not sure... */ | * On the other hand, it's using defines from space-file area, so not sure... */ | ||||
| int ED_path_extension_type(const char *path) | int ED_path_extension_type(const char *path) | ||||
| { | { | ||||
| if (BLO_has_bfile_extension(path)) { | if (BLO_has_bfile_extension(path)) { | ||||
| return FILE_TYPE_BLENDER; | return FILE_TYPE_BLENDER; | ||||
| } | } | ||||
| if (file_is_blend_backup(path)) { | if (BLO_has_bfile_backup_extension(path)) { | ||||
| return FILE_TYPE_BLENDER_BACKUP; | return FILE_TYPE_BLENDER_BACKUP; | ||||
| } | } | ||||
| #ifdef __APPLE__ | #ifdef __APPLE__ | ||||
| if (BLI_path_extension_check_n(path, | if (BLI_path_extension_check_n(path, | ||||
| /* Application bundle */ | /* Application bundle */ | ||||
| ".app", | ".app", | ||||
| /* Safari in-progress/paused download */ | /* Safari in-progress/paused download */ | ||||
| ".download", | ".download", | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||