Enhanced error message on folder creation with invalid chars on Windows
If the user tried to create folder with *, | or > in its name it would return a generic error "Could not create folder." Now the same message is shown when creating a folder with /, \\, :, *, |, > or ending with . or an empty space.
This commit is contained in:
parent
00125ef8df
commit
0759760856
@ -1217,7 +1217,8 @@ 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(".") || dir_name.ends_with(" ")) {
|
} else if (dir_name.find("/") != -1 || dir_name.find("\\") != -1 || dir_name.find(":") != -1 || 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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user