|
@@ -142,9 +142,9 @@ void EditorFileDialog::_native_dialog_cb(bool p_ok, const Vector<String> &p_file
|
|
} else if (filters.size() > 1 && p_filter == 0) {
|
|
} else if (filters.size() > 1 && p_filter == 0) {
|
|
// Match all filters.
|
|
// Match all filters.
|
|
for (int i = 0; i < filters.size(); i++) {
|
|
for (int i = 0; i < filters.size(); i++) {
|
|
- String flt = filters[i].get_slice(";", 0);
|
|
|
|
|
|
+ String flt = filters[i].get_slicec(';', 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_slicec(',', j).strip_edges();
|
|
if (f.matchn(str)) {
|
|
if (f.matchn(str)) {
|
|
valid = true;
|
|
valid = true;
|
|
break;
|
|
break;
|
|
@@ -160,10 +160,10 @@ void EditorFileDialog::_native_dialog_cb(bool p_ok, const Vector<String> &p_file
|
|
idx--;
|
|
idx--;
|
|
}
|
|
}
|
|
if (idx >= 0 && idx < filters.size()) {
|
|
if (idx >= 0 && idx < filters.size()) {
|
|
- String flt = filters[idx].get_slice(";", 0);
|
|
|
|
|
|
+ String flt = filters[idx].get_slicec(';', 0);
|
|
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_slicec(',', j).strip_edges();
|
|
if (f.matchn(str)) {
|
|
if (f.matchn(str)) {
|
|
valid = true;
|
|
valid = true;
|
|
break;
|
|
break;
|
|
@@ -171,7 +171,7 @@ void EditorFileDialog::_native_dialog_cb(bool p_ok, const Vector<String> &p_file
|
|
}
|
|
}
|
|
|
|
|
|
if (!valid && filter_slice_count > 0) {
|
|
if (!valid && filter_slice_count > 0) {
|
|
- String str = (flt.get_slice(",", 0).strip_edges());
|
|
|
|
|
|
+ String str = flt.get_slicec(',', 0).strip_edges();
|
|
f += str.substr(1);
|
|
f += str.substr(1);
|
|
file->set_text(f.get_file());
|
|
file->set_text(f.get_file());
|
|
valid = true;
|
|
valid = true;
|
|
@@ -184,8 +184,8 @@ void EditorFileDialog::_native_dialog_cb(bool p_ok, const Vector<String> &p_file
|
|
// Add first extension of filter if no valid extension is found.
|
|
// Add first extension of filter if no valid extension is found.
|
|
if (!valid) {
|
|
if (!valid) {
|
|
int idx = p_filter;
|
|
int idx = p_filter;
|
|
- String flt = filters[idx].get_slice(";", 0);
|
|
|
|
- String ext = flt.get_slice(",", 0).strip_edges().get_extension();
|
|
|
|
|
|
+ String flt = filters[idx].get_slicec(';', 0);
|
|
|
|
+ String ext = flt.get_slicec(',', 0).strip_edges().get_extension();
|
|
f += "." + ext;
|
|
f += "." + ext;
|
|
}
|
|
}
|
|
emit_signal(SNAME("file_selected"), f);
|
|
emit_signal(SNAME("file_selected"), f);
|
|
@@ -620,9 +620,9 @@ void EditorFileDialog::_action_pressed() {
|
|
} else if (filters.size() > 1 && filter->get_selected() == 0) {
|
|
} else if (filters.size() > 1 && filter->get_selected() == 0) {
|
|
// Match all filters.
|
|
// Match all filters.
|
|
for (int i = 0; i < filters.size(); i++) {
|
|
for (int i = 0; i < filters.size(); i++) {
|
|
- String flt = filters[i].get_slice(";", 0);
|
|
|
|
|
|
+ String flt = filters[i].get_slicec(';', 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_slicec(',', j).strip_edges();
|
|
if (f.matchn(str)) {
|
|
if (f.matchn(str)) {
|
|
valid = true;
|
|
valid = true;
|
|
break;
|
|
break;
|
|
@@ -638,10 +638,10 @@ void EditorFileDialog::_action_pressed() {
|
|
idx--;
|
|
idx--;
|
|
}
|
|
}
|
|
if (idx >= 0 && idx < filters.size()) {
|
|
if (idx >= 0 && idx < filters.size()) {
|
|
- String flt = filters[idx].get_slice(";", 0);
|
|
|
|
|
|
+ String flt = filters[idx].get_slicec(';', 0);
|
|
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_slicec(',', j).strip_edges());
|
|
if (f.matchn(str)) {
|
|
if (f.matchn(str)) {
|
|
valid = true;
|
|
valid = true;
|
|
break;
|
|
break;
|
|
@@ -649,7 +649,7 @@ void EditorFileDialog::_action_pressed() {
|
|
}
|
|
}
|
|
|
|
|
|
if (!valid && filter_slice_count > 0) {
|
|
if (!valid && filter_slice_count > 0) {
|
|
- String str = (flt.get_slice(",", 0).strip_edges());
|
|
|
|
|
|
+ String str = flt.get_slicec(',', 0).strip_edges();
|
|
f += str.substr(1);
|
|
f += str.substr(1);
|
|
_request_single_thumbnail(get_current_dir().path_join(f.get_file()));
|
|
_request_single_thumbnail(get_current_dir().path_join(f.get_file()));
|
|
file->set_text(f.get_file());
|
|
file->set_text(f.get_file());
|
|
@@ -671,8 +671,8 @@ void EditorFileDialog::_action_pressed() {
|
|
// Add first extension of filter if no valid extension is found.
|
|
// Add first extension of filter if no valid extension is found.
|
|
if (!valid) {
|
|
if (!valid) {
|
|
int idx = filter->get_selected();
|
|
int idx = filter->get_selected();
|
|
- String flt = filters[idx].get_slice(";", 0);
|
|
|
|
- String ext = flt.get_slice(",", 0).strip_edges().get_extension();
|
|
|
|
|
|
+ String flt = filters[idx].get_slicec(';', 0);
|
|
|
|
+ String ext = flt.get_slicec(',', 0).strip_edges().get_extension();
|
|
f += "." + ext;
|
|
f += "." + ext;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1105,9 +1105,9 @@ void EditorFileDialog::update_file_list() {
|
|
} else if (filters.size() > 1 && filter->get_selected() == 0) {
|
|
} else if (filters.size() > 1 && filter->get_selected() == 0) {
|
|
// match all filters
|
|
// match all filters
|
|
for (int i = 0; i < filters.size(); i++) {
|
|
for (int i = 0; i < filters.size(); i++) {
|
|
- String f = filters[i].get_slice(";", 0);
|
|
|
|
|
|
+ String f = filters[i].get_slicec(';', 0);
|
|
for (int j = 0; j < f.get_slice_count(","); j++) {
|
|
for (int j = 0; j < f.get_slice_count(","); j++) {
|
|
- patterns.push_back(f.get_slice(",", j).strip_edges());
|
|
|
|
|
|
+ patterns.push_back(f.get_slicec(',', j).strip_edges());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -1117,9 +1117,9 @@ void EditorFileDialog::update_file_list() {
|
|
}
|
|
}
|
|
|
|
|
|
if (idx >= 0 && idx < filters.size()) {
|
|
if (idx >= 0 && idx < filters.size()) {
|
|
- String f = filters[idx].get_slice(";", 0);
|
|
|
|
|
|
+ String f = filters[idx].get_slicec(';', 0);
|
|
for (int j = 0; j < f.get_slice_count(","); j++) {
|
|
for (int j = 0; j < f.get_slice_count(","); j++) {
|
|
- patterns.push_back(f.get_slice(",", j).strip_edges());
|
|
|
|
|
|
+ patterns.push_back(f.get_slicec(',', j).strip_edges());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|