diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-10-23 00:54:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-23 00:54:47 +0200 |
commit | f1f51f5d4b2a4cdf9668fb90387c5d062f2a548b (patch) | |
tree | 342cf9ca0599daccc76bed609fd8f41b7252290f | |
parent | 99cee2b41466ec3f17b80077c494355f05df00f8 (diff) | |
parent | bb7888debb8487f0a4dc44f33dde7c915c3d5f55 (diff) |
Merge pull request #54137 from zedutch/fix-quick-load-multi-base-types
-rw-r--r-- | editor/quick_open.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/editor/quick_open.cpp b/editor/quick_open.cpp index fc3abbb87e..f0ec78bde6 100644 --- a/editor/quick_open.cpp +++ b/editor/quick_open.cpp @@ -55,16 +55,23 @@ void EditorQuickOpen::_build_search_cache(EditorFileSystemDirectory *p_efsd) { _build_search_cache(p_efsd->get_subdir(i)); } + Vector<String> base_types = String(base_type).split(String(",")); for (int i = 0; i < p_efsd->get_file_count(); i++) { String file_type = p_efsd->get_file_type(i); - if (ClassDB::is_parent_class(file_type, base_type)) { - String file = p_efsd->get_file_path(i); - files.push_back(file.substr(6, file.length())); - - // Store refs to used icons. - String ext = file.get_extension(); - if (!icons.has(ext)) { - icons.insert(ext, get_theme_icon((has_theme_icon(file_type, SNAME("EditorIcons")) ? file_type : String("Object")), SNAME("EditorIcons"))); + // Iterate all possible base types. + for (String &parent_type : base_types) { + if (ClassDB::is_parent_class(file_type, parent_type)) { + String file = p_efsd->get_file_path(i); + files.push_back(file.substr(6, file.length())); + + // Store refs to used icons. + String ext = file.get_extension(); + if (!icons.has(ext)) { + icons.insert(ext, get_theme_icon((has_theme_icon(file_type, SNAME("EditorIcons")) ? file_type : String("Object")), SNAME("EditorIcons"))); + } + + // Stop testing base types as soon as we got a match. + break; } } } |