diff options
author | Silvano Cerza <silvanocerza@gmail.com> | 2018-10-18 21:15:08 +0200 |
---|---|---|
committer | Silvano Cerza <silvanocerza@gmail.com> | 2018-10-18 21:19:16 +0200 |
commit | 0759760856bd7d82b0a8f59ea266c92ff330d993 (patch) | |
tree | f33e558b138e55c48aa4f56a31fe2531dc5d969d | |
parent | 00125ef8df0c7964a71c6781bd65d0e242187b04 (diff) |
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.
-rw-r--r-- | editor/filesystem_dock.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 5d155c3014..b11c5c3bef 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -1217,7 +1217,8 @@ void FileSystemDock::_make_dir_confirm() { if (dir_name.length() == 0) { EditorNode::get_singleton()->show_warning(TTR("No name provided")); 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")); return; } |