mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Make File Dialog case insensitive
Change FileDialog and EditorFileDialog to use case insensitive string comparisons when saving files to avoid duplicate file extensions.
This commit is contained in:
@@ -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(",");
|
||||
for (int j = 0; j < filter_slice_count; j++) {
|
||||
String str = (flt.get_slice(",", j).strip_edges());
|
||||
if (f.match(str)) {
|
||||
if (f.matchn(str)) {
|
||||
valid = true;
|
||||
break;
|
||||
}
|
||||
@@ -565,7 +565,7 @@ void EditorFileDialog::_action_pressed() {
|
||||
String flt = filters[i].get_slice(";", 0);
|
||||
for (int j = 0; j < flt.get_slice_count(","); j++) {
|
||||
String str = flt.get_slice(",", j).strip_edges();
|
||||
if (f.match(str)) {
|
||||
if (f.matchn(str)) {
|
||||
valid = true;
|
||||
break;
|
||||
}
|
||||
@@ -584,7 +584,7 @@ void EditorFileDialog::_action_pressed() {
|
||||
int filterSliceCount = flt.get_slice_count(",");
|
||||
for (int j = 0; j < filterSliceCount; j++) {
|
||||
String str = (flt.get_slice(",", j).strip_edges());
|
||||
if (f.match(str)) {
|
||||
if (f.matchn(str)) {
|
||||
valid = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ void FileDialog::_native_dialog_cb(bool p_ok, const Vector<String> &p_files, int
|
||||
int filter_slice_count = flt.get_slice_count(",");
|
||||
for (int j = 0; j < filter_slice_count; j++) {
|
||||
String str = (flt.get_slice(",", j).strip_edges());
|
||||
if (f.match(str)) {
|
||||
if (f.matchn(str)) {
|
||||
valid = true;
|
||||
break;
|
||||
}
|
||||
@@ -473,7 +473,7 @@ void FileDialog::_action_pressed() {
|
||||
String flt = filters[i].get_slice(";", 0);
|
||||
for (int j = 0; j < flt.get_slice_count(","); j++) {
|
||||
String str = flt.get_slice(",", j).strip_edges();
|
||||
if (f.match(str)) {
|
||||
if (f.matchn(str)) {
|
||||
valid = true;
|
||||
break;
|
||||
}
|
||||
@@ -492,7 +492,7 @@ void FileDialog::_action_pressed() {
|
||||
int filterSliceCount = flt.get_slice_count(",");
|
||||
for (int j = 0; j < filterSliceCount; j++) {
|
||||
String str = (flt.get_slice(",", j).strip_edges());
|
||||
if (f.match(str)) {
|
||||
if (f.matchn(str)) {
|
||||
valid = true;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user