diff options
author | Pop0p <dromarddylan@gmail.com> | 2021-03-13 17:09:25 +0100 |
---|---|---|
committer | Pop0p <dromarddylan@gmail.com> | 2021-03-13 17:09:25 +0100 |
commit | c8538153b08c976f2a0aeba5c7385b8c8766fc62 (patch) | |
tree | dcb8b571ce7edee73861651b5b697e9a46b13c9d | |
parent | 942f5f0cb282cbc2b3fb766e3c7614e82b98dd9b (diff) |
trims_whitespaces_when_creating_folder_windows
When creating a Windows folder via a Godot's dialog, the extra spaces are not removed which causes problems with Windows. We now remove leading and trailing whitespace when creating a dir.
-rw-r--r-- | editor/editor_file_dialog.cpp | 4 | ||||
-rw-r--r-- | scene/gui/file_dialog.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 6d694358bf..f78da9569f 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -1076,9 +1076,9 @@ EditorFileDialog::Access EditorFileDialog::get_access() const { } void EditorFileDialog::_make_dir_confirm() { - Error err = dir_access->make_dir(makedirname->get_text()); + Error err = dir_access->make_dir(makedirname->get_text().strip_edges()); if (err == OK) { - dir_access->change_dir(makedirname->get_text()); + dir_access->change_dir(makedirname->get_text().strip_edges()); invalidate(); update_filters(); update_dir(); diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 7453324505..7fb5113130 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -731,9 +731,9 @@ FileDialog::Access FileDialog::get_access() const { } void FileDialog::_make_dir_confirm() { - Error err = dir_access->make_dir(makedirname->get_text()); + Error err = dir_access->make_dir(makedirname->get_text().strip_edges()); if (err == OK) { - dir_access->change_dir(makedirname->get_text()); + dir_access->change_dir(makedirname->get_text().strip_edges()); invalidate(); update_filters(); update_dir(); |