@@ -647,8 +647,7 @@ void FileSystemDock::_notification(int p_what) {
647647 }
648648
649649 if (do_redraw) {
650- _update_file_list (true );
651- _update_tree (get_uncollapsed_paths ());
650+ update_all ();
652651 }
653652
654653 if (EditorThemeManager::is_generated_theme_outdated ()) {
@@ -1300,13 +1299,7 @@ void FileSystemDock::_fs_changed() {
13001299 scanning_vb->hide ();
13011300 split_box->show ();
13021301
1303- if (tree->is_visible ()) {
1304- _update_tree (get_uncollapsed_paths ());
1305- }
1306-
1307- if (file_list_vb->is_visible ()) {
1308- _update_file_list (true );
1309- }
1302+ update_all ();
13101303
13111304 if (!select_after_scan.is_empty ()) {
13121305 _navigate_to_path (select_after_scan);
@@ -1318,15 +1311,6 @@ void FileSystemDock::_fs_changed() {
13181311 set_process (false );
13191312}
13201313
1321- void FileSystemDock::_directory_created (const String &p_path) {
1322- if (!DirAccess::exists (p_path)) {
1323- return ;
1324- }
1325- EditorFileSystem::get_singleton ()->add_new_directory (p_path);
1326- _update_tree (get_uncollapsed_paths ());
1327- _update_file_list (true );
1328- }
1329-
13301314void FileSystemDock::_set_scanning_mode () {
13311315 button_hist_prev->set_disabled (true );
13321316 button_hist_next->set_disabled (true );
@@ -2697,6 +2681,16 @@ void FileSystemDock::fix_dependencies(const String &p_for_file) {
26972681 deps_editor->edit (p_for_file);
26982682}
26992683
2684+ void FileSystemDock::update_all () {
2685+ if (tree->is_visible ()) {
2686+ _update_tree (get_uncollapsed_paths ());
2687+ }
2688+
2689+ if (file_list_vb->is_visible ()) {
2690+ _update_file_list (true );
2691+ }
2692+ }
2693+
27002694void FileSystemDock::focus_on_path () {
27012695 current_path_line_edit->grab_focus ();
27022696 current_path_line_edit->select_all ();
@@ -3118,9 +3112,7 @@ void FileSystemDock::_folder_color_index_pressed(int p_index, PopupMenu *p_menu)
31183112 }
31193113
31203114 _update_folder_colors_setting ();
3121-
3122- _update_tree (get_uncollapsed_paths ());
3123- _update_file_list (true );
3115+ update_all ();
31243116
31253117 emit_signal (SNAME (" folder_color_changed" ));
31263118}
@@ -3793,8 +3785,7 @@ void FileSystemDock::set_file_sort(FileSortOption p_file_sort) {
37933785 file_sort = p_file_sort;
37943786
37953787 // Update everything needed.
3796- _update_tree (get_uncollapsed_paths ());
3797- _update_file_list (true );
3788+ update_all ();
37983789}
37993790
38003791void FileSystemDock::_file_sort_popup (int p_id) {
@@ -4184,7 +4175,6 @@ FileSystemDock::FileSystemDock() {
41844175
41854176 make_dir_dialog = memnew (DirectoryCreateDialog);
41864177 add_child (make_dir_dialog);
4187- make_dir_dialog->connect (" dir_created" , callable_mp (this , &FileSystemDock::_directory_created));
41884178
41894179 make_scene_dialog = memnew (SceneCreateDialog);
41904180 add_child (make_scene_dialog);
0 commit comments