Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_file/filesel.c')
-rw-r--r--source/blender/editors/space_file/filesel.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index f6629061878..011506368ee 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -515,19 +515,15 @@ void ED_fileselect_activate_by_id(SpaceFile *sfile, ID *asset_id, const bool def
FileSelectParams *params = ED_fileselect_get_active_params(sfile);
struct FileList *files = sfile->files;
- const int num_files_filtered = filelist_files_ensure(files);
- for (int file_index = 0; file_index < num_files_filtered; ++file_index) {
- const FileDirEntry *file = filelist_file_ex(files, file_index, false);
-
- if (filelist_file_get_id(file) != asset_id) {
- continue;
- }
-
- params->active_file = file_index;
- filelist_entry_select_set(files, file, FILE_SEL_ADD, FILE_SEL_SELECTED, CHECK_ALL);
- break;
+ const int file_index = filelist_file_find_id(files, asset_id);
+ const FileDirEntry *file = filelist_file_ex(files, file_index, true);
+ if (file == NULL) {
+ return;
}
+ params->active_file = file_index;
+ filelist_entry_select_set(files, file, FILE_SEL_ADD, FILE_SEL_SELECTED, CHECK_ALL);
+
WM_main_add_notifier(NC_ASSET | NA_ACTIVATED, NULL);
WM_main_add_notifier(NC_ASSET | NA_SELECTED, NULL);
}
@@ -1129,8 +1125,8 @@ int file_select_match(struct SpaceFile *sfile, const char *pattern, char *matche
*/
for (int i = 0; i < n; i++) {
FileDirEntry *file = filelist_file(sfile->files, i);
- /* Do not check whether file is a file or dir here! Causes T44243
- * (we do accept dirs at this stage). */
+ /* Do not check whether file is a file or dir here! Causes: T44243
+ * (we do accept directories at this stage). */
if (fnmatch(pattern, file->relpath, 0) == 0) {
filelist_entry_select_set(sfile->files, file, FILE_SEL_ADD, FILE_SEL_SELECTED, CHECK_ALL);
if (!match) {