Merge pull request #18552 from Falke117/trailingSpace
Folder name with trailing space fix
This commit is contained in:
commit
2e474f42b8
2 changed files with 4 additions and 2 deletions
|
@ -945,7 +945,7 @@ void FileSystemDock::_make_dir_confirm() {
|
||||||
if (dir_name.length() == 0) {
|
if (dir_name.length() == 0) {
|
||||||
EditorNode::get_singleton()->show_warning(TTR("No name provided"));
|
EditorNode::get_singleton()->show_warning(TTR("No name provided"));
|
||||||
return;
|
return;
|
||||||
} else if (dir_name.find("/") != -1 || dir_name.find("\\") != -1 || dir_name.find(":") != -1 || dir_name.ends_with(".")) {
|
} else if (dir_name.find("/") != -1 || dir_name.find("\\") != -1 || dir_name.find(":") != -1 || dir_name.ends_with(".") || dir_name.ends_with(" ")) {
|
||||||
EditorNode::get_singleton()->show_warning(TTR("Provided name contains invalid characters"));
|
EditorNode::get_singleton()->show_warning(TTR("Provided name contains invalid characters"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,8 +250,10 @@ private:
|
||||||
|
|
||||||
void _create_folder() {
|
void _create_folder() {
|
||||||
|
|
||||||
if (project_name->get_text() == "" || created_folder_path != "")
|
if (project_name->get_text() == "" || created_folder_path != "" || project_name->get_text().ends_with(".") || project_name->get_text().ends_with(" ")) {
|
||||||
|
set_message(TTR("Invalid Project Name."), MESSAGE_WARNING);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
|
DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
|
||||||
if (d->change_dir(project_path->get_text()) == OK) {
|
if (d->change_dir(project_path->get_text()) == OK) {
|
||||||
|
|
Loading…
Reference in a new issue