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.

(cherry picked from commit c8538153b0)
This commit is contained in:
Pop0p 2021-03-13 17:09:25 +01:00 committed by Rémi Verschelde
parent 7c7f4602e7
commit d2a577f7f1
No known key found for this signature in database
GPG key ID: C3336907360768E1
2 changed files with 4 additions and 4 deletions

View file

@ -1105,9 +1105,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();

View file

@ -761,9 +761,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();