From 01d1f10845239109783ed462fea869363d42caba Mon Sep 17 00:00:00 2001 From: Nazarii Date: Sun, 27 Oct 2024 18:17:46 +0200 Subject: Emit filesystem_changed only once per frame --- editor/editor_file_system.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'editor/editor_file_system.cpp') diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 50595ec7a6..cd02482bc7 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -2376,10 +2376,18 @@ void EditorFileSystem::update_files(const Vector &p_script_paths) { if (!is_scanning()) { _process_update_pending(); } - call_deferred(SNAME("emit_signal"), "filesystem_changed"); // Update later + if (!filesystem_changed_queued) { + filesystem_changed_queued = true; + callable_mp(this, &EditorFileSystem::_notify_filesystem_changed).call_deferred(); + } } } +void EditorFileSystem::_notify_filesystem_changed() { + emit_signal("filesystem_changed"); + filesystem_changed_queued = false; +} + HashSet EditorFileSystem::get_valid_extensions() const { return valid_extensions; } -- cgit v1.2.3