Remove String::find_last (same as rfind)

This commit is contained in:
Stijn Hinlopen 2020-07-03 15:26:22 +02:00
parent fd5b6e1db2
commit 929b98d24b
26 changed files with 41 additions and 80 deletions

View file

@ -78,7 +78,7 @@ void ScriptCreateDialog::_notification(int p_what) {
void ScriptCreateDialog::_path_hbox_sorted() {
if (is_visible()) {
int filename_start_pos = initial_bp.find_last("/") + 1;
int filename_start_pos = initial_bp.rfind("/") + 1;
int filename_end_pos = initial_bp.length();
if (!is_built_in) {
@ -553,7 +553,7 @@ void ScriptCreateDialog::_file_selected(const String &p_file) {
_path_changed(p);
String filename = p.get_file().get_basename();
int select_start = p.find_last(filename);
int select_start = p.rfind(filename);
file_path->select(select_start, select_start + filename.length());
file_path->set_cursor_position(select_start + filename.length());
file_path->grab_focus();