From ad99c7947274685b8e3acc3f1ba3f18f66b1f769 Mon Sep 17 00:00:00 2001 From: kobewi Date: Mon, 16 Sep 2024 15:52:51 +0200 Subject: Rework creating new folders in editor --- editor/directory_create_dialog.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'editor/directory_create_dialog.cpp') diff --git a/editor/directory_create_dialog.cpp b/editor/directory_create_dialog.cpp index 604531f109..46baa2c6e1 100644 --- a/editor/directory_create_dialog.cpp +++ b/editor/directory_create_dialog.cpp @@ -31,6 +31,7 @@ #include "directory_create_dialog.h" #include "core/io/dir_access.h" +#include "editor/editor_file_system.h" #include "editor/editor_node.h" #include "editor/gui/editor_validation_panel.h" #include "editor/themes/editor_scale.h" @@ -100,15 +101,7 @@ void DirectoryCreateDialog::ok_pressed() { const String error = _validate_path(path); ERR_FAIL_COND_MSG(!error.is_empty(), error); - Error err; - Ref da = DirAccess::create(DirAccess::ACCESS_RESOURCES); - - err = da->change_dir(base_dir); - ERR_FAIL_COND_MSG(err != OK, "Cannot open directory '" + base_dir + "'."); - - print_verbose("Making folder " + path + " in " + base_dir); - err = da->make_dir_recursive(path); - + Error err = EditorFileSystem::get_singleton()->make_dir_recursive(path, base_dir); if (err == OK) { emit_signal(SNAME("dir_created"), base_dir.path_join(path)); } else { -- cgit v1.2.3