diff options
Diffstat (limited to 'editor/filesystem_dock.cpp')
-rw-r--r-- | editor/filesystem_dock.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index bc71072d29..a038da4c18 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -629,7 +629,7 @@ void FileSystemDock::_search(EditorFileSystemDirectory *p_path, List<FileInfo> * for (int i = 0; i < p_path->get_file_count(); i++) { String file = p_path->get_file(i); - if (file.to_lower().find(searched_string) != -1) { + if (file.to_lower().contains(searched_string)) { FileInfo fi; fi.name = file; fi.type = p_path->get_file_type(i); @@ -1373,8 +1373,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.find("*") != -1 || - dir_name.find("|") != -1 || dir_name.find(">") != -1 || dir_name.ends_with(".") || dir_name.ends_with(" ")) { + } else if (dir_name.contains("/") || dir_name.contains("\\") || dir_name.contains(":") || dir_name.contains("*") || + dir_name.contains("|") || dir_name.contains(">") || dir_name.ends_with(".") || dir_name.ends_with(" ")) { EditorNode::get_singleton()->show_warning(TTR("Provided name contains invalid characters.")); return; } @@ -1478,7 +1478,7 @@ void FileSystemDock::_rename_operation_confirm() { if (new_name.length() == 0) { EditorNode::get_singleton()->show_warning(TTR("No name provided.")); return; - } else if (new_name.find("/") != -1 || new_name.find("\\") != -1 || new_name.find(":") != -1) { + } else if (new_name.contains("/") || new_name.contains("\\") || new_name.contains(":")) { EditorNode::get_singleton()->show_warning(TTR("Name contains invalid characters.")); return; } else if (to_rename.is_file && old_name.get_extension() != new_name.get_extension()) { @@ -1540,7 +1540,7 @@ void FileSystemDock::_duplicate_operation_confirm() { if (new_name.length() == 0) { EditorNode::get_singleton()->show_warning(TTR("No name provided.")); return; - } else if (new_name.find("/") != -1 || new_name.find("\\") != -1 || new_name.find(":") != -1) { + } else if (new_name.contains("/") || new_name.contains("\\") || new_name.contains(":")) { EditorNode::get_singleton()->show_warning(TTR("Name contains invalid characters.")); return; } |