Fix ProgressDialog crash when importing TTF font

This commit is contained in:
Hilderin 2024-06-14 09:00:42 -04:00
parent 680e489189
commit 8a82d3e9a7

View File

@ -1718,6 +1718,7 @@ void EditorFileSystem::update_file(const String &p_file) {
} }
void EditorFileSystem::update_files(const Vector<String> &p_script_paths) { void EditorFileSystem::update_files(const Vector<String> &p_script_paths) {
bool updated = false;
for (const String &file : p_script_paths) { for (const String &file : p_script_paths) {
ERR_CONTINUE(file.is_empty()); ERR_CONTINUE(file.is_empty());
EditorFileSystemDirectory *fs = nullptr; EditorFileSystemDirectory *fs = nullptr;
@ -1747,6 +1748,7 @@ void EditorFileSystem::update_files(const Vector<String> &p_script_paths) {
memdelete(fs->files[cpos]); memdelete(fs->files[cpos]);
fs->files.remove_at(cpos); fs->files.remove_at(cpos);
updated = true;
} }
} else { } else {
String type = ResourceLoader::get_resource_type(file); String type = ResourceLoader::get_resource_type(file);
@ -1814,12 +1816,15 @@ void EditorFileSystem::update_files(const Vector<String> &p_script_paths) {
if (fs->files[cpos]->type == SNAME("PackedScene")) { if (fs->files[cpos]->type == SNAME("PackedScene")) {
_queue_update_scene_groups(file); _queue_update_scene_groups(file);
} }
updated = true;
} }
} }
_update_pending_script_classes(); if (updated) {
_update_pending_scene_groups(); _update_pending_script_classes();
call_deferred(SNAME("emit_signal"), "filesystem_changed"); //update later _update_pending_scene_groups();
call_deferred(SNAME("emit_signal"), "filesystem_changed"); //update later
}
} }
HashSet<String> EditorFileSystem::get_valid_extensions() const { HashSet<String> EditorFileSystem::get_valid_extensions() const {