summaryrefslogtreecommitdiffstats
path: root/editor/directory_create_dialog.cpp
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2024-09-16 15:52:51 +0200
committerkobewi <kobewi4e@gmail.com>2024-09-17 12:40:25 +0200
commitad99c7947274685b8e3acc3f1ba3f18f66b1f769 (patch)
tree40c8a64bbdc8a212cd8ab5dc8f75a1e13e6317a6 /editor/directory_create_dialog.cpp
parenta75bacebef979a17b549c6577defbbfd2f7ef2e0 (diff)
downloadredot-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.cpp11
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 {