Merge pull request #85789 from DevilboxGames/FileDialogCaseSensitivity

Make `FileDialog` filtering case insensitive
This commit is contained in:
Rémi Verschelde
2024-11-29 22:45:32 +01:00
2 changed files with 6 additions and 6 deletions

View File

@ -127,7 +127,7 @@ void EditorFileDialog::_native_dialog_cb(bool p_ok, const Vector<String> &p_file
int filter_slice_count = flt.get_slice_count(","); int filter_slice_count = flt.get_slice_count(",");
for (int j = 0; j < filter_slice_count; j++) { for (int j = 0; j < filter_slice_count; j++) {
String str = (flt.get_slice(",", j).strip_edges()); String str = (flt.get_slice(",", j).strip_edges());
if (f.match(str)) { if (f.matchn(str)) {
valid = true; valid = true;
break; break;
} }
@ -565,7 +565,7 @@ void EditorFileDialog::_action_pressed() {
String flt = filters[i].get_slice(";", 0); String flt = filters[i].get_slice(";", 0);
for (int j = 0; j < flt.get_slice_count(","); j++) { for (int j = 0; j < flt.get_slice_count(","); j++) {
String str = flt.get_slice(",", j).strip_edges(); String str = flt.get_slice(",", j).strip_edges();
if (f.match(str)) { if (f.matchn(str)) {
valid = true; valid = true;
break; break;
} }
@ -584,7 +584,7 @@ void EditorFileDialog::_action_pressed() {
int filterSliceCount = flt.get_slice_count(","); int filterSliceCount = flt.get_slice_count(",");
for (int j = 0; j < filterSliceCount; j++) { for (int j = 0; j < filterSliceCount; j++) {
String str = (flt.get_slice(",", j).strip_edges()); String str = (flt.get_slice(",", j).strip_edges());
if (f.match(str)) { if (f.matchn(str)) {
valid = true; valid = true;
break; break;
} }

View File

@ -153,7 +153,7 @@ void FileDialog::_native_dialog_cb_with_options(bool p_ok, const Vector<String>
int filter_slice_count = flt.get_slice_count(","); int filter_slice_count = flt.get_slice_count(",");
for (int j = 0; j < filter_slice_count; j++) { for (int j = 0; j < filter_slice_count; j++) {
String str = (flt.get_slice(",", j).strip_edges()); String str = (flt.get_slice(",", j).strip_edges());
if (f.match(str)) { if (f.matchn(str)) {
valid = true; valid = true;
break; break;
} }
@ -488,7 +488,7 @@ void FileDialog::_action_pressed() {
String flt = filters[i].get_slice(";", 0); String flt = filters[i].get_slice(";", 0);
for (int j = 0; j < flt.get_slice_count(","); j++) { for (int j = 0; j < flt.get_slice_count(","); j++) {
String str = flt.get_slice(",", j).strip_edges(); String str = flt.get_slice(",", j).strip_edges();
if (f.match(str)) { if (f.matchn(str)) {
valid = true; valid = true;
break; break;
} }
@ -507,7 +507,7 @@ void FileDialog::_action_pressed() {
int filterSliceCount = flt.get_slice_count(","); int filterSliceCount = flt.get_slice_count(",");
for (int j = 0; j < filterSliceCount; j++) { for (int j = 0; j < filterSliceCount; j++) {
String str = (flt.get_slice(",", j).strip_edges()); String str = (flt.get_slice(",", j).strip_edges());
if (f.match(str)) { if (f.matchn(str)) {
valid = true; valid = true;
break; break;
} }