Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_file/filesel.c
| Show First 20 Lines • Show All 525 Lines • ▼ Show 20 Lines | if (deferred || filelist_pending(sfile->files) || filelist_needs_force_reset(sfile->files)) { | ||||
| * thread as well. */ | * thread as well. */ | ||||
| file_on_reload_callback_register(sfile, on_reload_activate_by_id, asset_id); | file_on_reload_callback_register(sfile, on_reload_activate_by_id, asset_id); | ||||
| return; | return; | ||||
| } | } | ||||
| FileSelectParams *params = ED_fileselect_get_active_params(sfile); | FileSelectParams *params = ED_fileselect_get_active_params(sfile); | ||||
| struct FileList *files = sfile->files; | struct FileList *files = sfile->files; | ||||
| const int num_files_filtered = filelist_files_ensure(files); | const int file_index = filelist_file_find_id(files, asset_id); | ||||
| for (int file_index = 0; file_index < num_files_filtered; ++file_index) { | const FileDirEntry *file = filelist_file_ex(files, file_index, true); | ||||
| const FileDirEntry *file = filelist_file_ex(files, file_index, false); | if (file == NULL) { | ||||
| return; | |||||
| if (filelist_file_get_id(file) != asset_id) { | |||||
| continue; | |||||
| } | } | ||||
| params->active_file = file_index; | params->active_file = file_index; | ||||
| filelist_entry_select_set(files, file, FILE_SEL_ADD, FILE_SEL_SELECTED, CHECK_ALL); | filelist_entry_select_set(files, file, FILE_SEL_ADD, FILE_SEL_SELECTED, CHECK_ALL); | ||||
| break; | |||||
| } | |||||
| WM_main_add_notifier(NC_ASSET | NA_ACTIVATED, NULL); | WM_main_add_notifier(NC_ASSET | NA_ACTIVATED, NULL); | ||||
| WM_main_add_notifier(NC_ASSET | NA_SELECTED, NULL); | WM_main_add_notifier(NC_ASSET | NA_SELECTED, NULL); | ||||
| } | } | ||||
| static void on_reload_select_by_relpath(SpaceFile *sfile, onReloadFnData custom_data) | static void on_reload_select_by_relpath(SpaceFile *sfile, onReloadFnData custom_data) | ||||
| { | { | ||||
| const char *relative_path = custom_data; | const char *relative_path = custom_data; | ||||
| ▲ Show 20 Lines • Show All 833 Lines • Show Last 20 Lines | |||||