Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_file/filelist.cc
| Show First 20 Lines • Show All 382 Lines • ▼ Show 20 Lines | |||||
| static int compare_direntry_generic(const FileListInternEntry *entry1, | static int compare_direntry_generic(const FileListInternEntry *entry1, | ||||
| const FileListInternEntry *entry2) | const FileListInternEntry *entry2) | ||||
| { | { | ||||
| /* type is equal to stat.st_mode */ | /* type is equal to stat.st_mode */ | ||||
| if (entry1->typeflag & FILE_TYPE_DIR) { | if (entry1->typeflag & FILE_TYPE_DIR) { | ||||
| if (entry2->typeflag & FILE_TYPE_DIR) { | if (entry2->typeflag & FILE_TYPE_DIR) { | ||||
| /* If both entries are tagged as dirs, we make a 'sub filter' that shows first the real dirs, | /* If both entries are tagged as dirs, we make a 'sub filter' that shows first the real dirs, | ||||
| * then libs (.blend files), then categories in libs. */ | * then libraries (.blend files), then categories in libraries. */ | ||||
| if (entry1->typeflag & FILE_TYPE_BLENDERLIB) { | if (entry1->typeflag & FILE_TYPE_BLENDERLIB) { | ||||
| if (!(entry2->typeflag & FILE_TYPE_BLENDERLIB)) { | if (!(entry2->typeflag & FILE_TYPE_BLENDERLIB)) { | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| } | } | ||||
| else if (entry2->typeflag & FILE_TYPE_BLENDERLIB) { | else if (entry2->typeflag & FILE_TYPE_BLENDERLIB) { | ||||
| return -1; | return -1; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 2,517 Lines • ▼ Show 20 Lines | #endif | ||||
| MEM_freeN(entry->redirection_path); | MEM_freeN(entry->redirection_path); | ||||
| entry->redirection_path = NULL; | entry->redirection_path = NULL; | ||||
| entry->attributes |= FILE_ATTR_HIDDEN; | entry->attributes |= FILE_ATTR_HIDDEN; | ||||
| } | } | ||||
| } | } | ||||
| if (!(entry->typeflag & FILE_TYPE_DIR)) { | if (!(entry->typeflag & FILE_TYPE_DIR)) { | ||||
| if (do_lib && BLO_has_bfile_extension(target)) { | if (do_lib && BLO_has_bfile_extension(target)) { | ||||
| /* If we are considering .blend files as libs, promote them to directory status. */ | /* If we are considering .blend files as libraries, promote them to directory status. */ | ||||
| entry->typeflag = FILE_TYPE_BLENDER; | entry->typeflag = FILE_TYPE_BLENDER; | ||||
| /* prevent current file being used as acceptable dir */ | /* prevent current file being used as acceptable dir */ | ||||
| if (BLI_path_cmp(main_name, target) != 0) { | if (BLI_path_cmp(main_name, target) != 0) { | ||||
| entry->typeflag |= FILE_TYPE_DIR; | entry->typeflag |= FILE_TYPE_DIR; | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| entry->typeflag = (eFileSel_File_Types)ED_path_extension_type(target); | entry->typeflag = (eFileSel_File_Types)ED_path_extension_type(target); | ||||
| ▲ Show 20 Lines • Show All 1,020 Lines • Show Last 20 Lines | |||||