diff options
author | Yuri Sizov <yuris@humnom.net> | 2024-01-17 18:52:35 +0100 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2024-01-17 18:52:35 +0100 |
commit | d92d8a49aa941363b5cedc4541d9fe64145a5daf (patch) | |
tree | 5614b81a7ef4f824aa2deed7266ae715483d92d7 /editor/filesystem_dock.cpp | |
parent | 28cf7fe2f605d22206d1ea5582dad2eebedc6a2a (diff) | |
parent | 5b57db263777388899847cd0a3f27421fee61e93 (diff) | |
download | redot-engine-d92d8a49aa941363b5cedc4541d9fe64145a5daf.tar.gz |
Merge pull request #86064 from jsjtxietian/fix-sort-by-type
Fix "Class name cannot be empty" error when sorting no import files sort by type
Diffstat (limited to 'editor/filesystem_dock.cpp')
-rw-r--r-- | editor/filesystem_dock.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index a46dffb1f3..0aa9a3bfee 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -865,18 +865,7 @@ void FileSystemDock::_search(EditorFileSystemDirectory *p_path, List<FileInfo> * struct FileSystemDock::FileInfoTypeComparator { bool operator()(const FileInfo &p_a, const FileInfo &p_b) const { - // Uses the extension, then the icon name to distinguish file types. - String icon_path_a = ""; - String icon_path_b = ""; - Ref<Texture2D> icon_a = EditorNode::get_singleton()->get_class_icon(p_a.type); - if (icon_a.is_valid()) { - icon_path_a = icon_a->get_name(); - } - Ref<Texture2D> icon_b = EditorNode::get_singleton()->get_class_icon(p_b.type); - if (icon_b.is_valid()) { - icon_path_b = icon_b->get_name(); - } - return NaturalNoCaseComparator()(p_a.name.get_extension() + icon_path_a + p_a.name.get_basename(), p_b.name.get_extension() + icon_path_b + p_b.name.get_basename()); + return NaturalNoCaseComparator()(p_a.name.get_extension() + p_a.type + p_a.name.get_basename(), p_b.name.get_extension() + p_b.type + p_b.name.get_basename()); } }; |