diff options
author | kobewi <kobewi4e@gmail.com> | 2024-09-16 15:52:51 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2024-09-17 12:40:25 +0200 |
commit | ad99c7947274685b8e3acc3f1ba3f18f66b1f769 (patch) | |
tree | 40c8a64bbdc8a212cd8ab5dc8f75a1e13e6317a6 /editor/directory_create_dialog.cpp | |
parent | a75bacebef979a17b549c6577defbbfd2f7ef2e0 (diff) | |
download | redot-engine-ad99c7947274685b8e3acc3f1ba3f18f66b1f769.tar.gz |
Rework creating new folders in editor
Diffstat (limited to 'editor/directory_create_dialog.cpp')
-rw-r--r-- | editor/directory_create_dialog.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
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<DirAccess> 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 { |