Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_file/space_file.c
| Show First 20 Lines • Show All 951 Lines • ▼ Show 20 Lines | for (int file_index = 0; file_index < num_files_filtered; file_index++) { | ||||
| CTX_data_list_add(result, &screen->id, &RNA_FileSelectEntry, entry); | CTX_data_list_add(result, &screen->id, &RNA_FileSelectEntry, entry); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION); | CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION); | ||||
| return CTX_RESULT_OK; | return CTX_RESULT_OK; | ||||
| } | } | ||||
| if (CTX_data_equals(member, "selected_ids")) { | |||||
| const int num_files_filtered = filelist_files_ensure(sfile->files); | |||||
| for (int file_index = 0; file_index < num_files_filtered; file_index++) { | |||||
| if (filelist_entry_is_selected(sfile->files, file_index)) { | |||||
| FileDirEntry *entry = filelist_file(sfile->files, file_index); | |||||
| ID *id = filelist_file_get_id(entry); | |||||
| if (id == NULL) { | |||||
Severin: Needs a null-check for `id`. Only assets stored in the current files will have one. | |||||
| continue; | |||||
| } | |||||
| CTX_data_id_list_add(result, id); | |||||
| } | |||||
| } | |||||
| CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION); | |||||
| return CTX_RESULT_OK; | |||||
| } | |||||
| if (CTX_data_equals(member, "id")) { | if (CTX_data_equals(member, "id")) { | ||||
| const FileDirEntry *file = filelist_file(sfile->files, params->active_file); | const FileDirEntry *file = filelist_file(sfile->files, params->active_file); | ||||
| if (file == NULL) { | if (file == NULL) { | ||||
| return CTX_RESULT_NO_DATA; | return CTX_RESULT_NO_DATA; | ||||
| } | } | ||||
| ID *id = filelist_file_get_id(file); | ID *id = filelist_file_get_id(file); | ||||
| if (id == NULL) { | if (id == NULL) { | ||||
| ▲ Show 20 Lines • Show All 145 Lines • Show Last 20 Lines | |||||
Needs a null-check for id. Only assets stored in the current files will have one.