@@ -649,8 +649,7 @@ void FileSystemDock::_notification(int p_what) {
649649 }
650650
651651 if (do_redraw) {
652- _update_file_list (true );
653- _update_tree (get_uncollapsed_paths ());
652+ update_all ();
654653 }
655654
656655 if (EditorThemeManager::is_generated_theme_outdated ()) {
@@ -1343,13 +1342,7 @@ void FileSystemDock::_fs_changed() {
13431342 scanning_vb->hide ();
13441343 split_box->show ();
13451344
1346- if (tree->is_visible ()) {
1347- _update_tree (get_uncollapsed_paths ());
1348- }
1349-
1350- if (file_list_vb->is_visible ()) {
1351- _update_file_list (true );
1352- }
1345+ update_all ();
13531346
13541347 if (!select_after_scan.is_empty ()) {
13551348 _navigate_to_path (select_after_scan);
@@ -1361,15 +1354,6 @@ void FileSystemDock::_fs_changed() {
13611354 set_process (false );
13621355}
13631356
1364- void FileSystemDock::_directory_created (const String &p_path) {
1365- if (!DirAccess::exists (p_path)) {
1366- return ;
1367- }
1368- EditorFileSystem::get_singleton ()->add_new_directory (p_path);
1369- _update_tree (get_uncollapsed_paths ());
1370- _update_file_list (true );
1371- }
1372-
13731357void FileSystemDock::_set_scanning_mode () {
13741358 button_hist_prev->set_disabled (true );
13751359 button_hist_next->set_disabled (true );
@@ -2820,6 +2804,16 @@ void FileSystemDock::fix_dependencies(const String &p_for_file) {
28202804 deps_editor->edit (p_for_file);
28212805}
28222806
2807+ void FileSystemDock::update_all () {
2808+ if (tree->is_visible ()) {
2809+ _update_tree (get_uncollapsed_paths ());
2810+ }
2811+
2812+ if (file_list_vb->is_visible ()) {
2813+ _update_file_list (true );
2814+ }
2815+ }
2816+
28232817void FileSystemDock::focus_on_path () {
28242818 current_path_line_edit->grab_focus ();
28252819 current_path_line_edit->select_all ();
@@ -3241,9 +3235,7 @@ void FileSystemDock::_folder_color_index_pressed(int p_index, PopupMenu *p_menu)
32413235 }
32423236
32433237 _update_folder_colors_setting ();
3244-
3245- _update_tree (get_uncollapsed_paths ());
3246- _update_file_list (true );
3238+ update_all ();
32473239
32483240 emit_signal (SNAME (" folder_color_changed" ));
32493241}
@@ -3951,8 +3943,7 @@ void FileSystemDock::set_file_sort(FileSortOption p_file_sort) {
39513943 file_sort = p_file_sort;
39523944
39533945 // Update everything needed.
3954- _update_tree (get_uncollapsed_paths ());
3955- _update_file_list (true );
3946+ update_all ();
39563947}
39573948
39583949void FileSystemDock::_file_sort_popup (int p_id) {
@@ -4342,7 +4333,6 @@ FileSystemDock::FileSystemDock() {
43424333
43434334 make_dir_dialog = memnew (DirectoryCreateDialog);
43444335 add_child (make_dir_dialog);
4345- make_dir_dialog->connect (" dir_created" , callable_mp (this , &FileSystemDock::_directory_created));
43464336
43474337 make_scene_dialog = memnew (SceneCreateDialog);
43484338 add_child (make_scene_dialog);
0 commit comments