mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-23 20:36:53 +01:00
Fix FileDialog file name autocompletion with filters
Fixes #38195. (cherry picked from commit 446f1b70522d86b9afe93b6543028cbab60ffb61)
This commit is contained in:
parent
0ed75059cc
commit
cb93141c27
@ -730,9 +730,9 @@ void EditorFileDialog::update_file_name() {
|
||||
String base_name = file_str.get_basename();
|
||||
Vector<String> filter_substr = filter_str.split(";");
|
||||
if (filter_substr.size() >= 2) {
|
||||
file_str = base_name + "." + filter_substr[0].strip_edges().lstrip("*.").to_lower();
|
||||
file_str = base_name + "." + filter_substr[0].strip_edges().get_extension().to_lower();
|
||||
} else {
|
||||
file_str = base_name + "." + filter_str.get_extension().strip_edges().to_lower();
|
||||
file_str = base_name + "." + filter_str.strip_edges().get_extension().to_lower();
|
||||
}
|
||||
file->set_text(file_str);
|
||||
}
|
||||
|
@ -405,7 +405,12 @@ void FileDialog::update_file_name() {
|
||||
String filter_str = filters[idx];
|
||||
String file_str = file->get_text();
|
||||
String base_name = file_str.get_basename();
|
||||
file_str = base_name + "." + filter_str.strip_edges().to_lower();
|
||||
Vector<String> filter_substr = filter_str.split(";");
|
||||
if (filter_substr.size() >= 2) {
|
||||
file_str = base_name + "." + filter_substr[0].strip_edges().get_extension().to_lower();
|
||||
} else {
|
||||
file_str = base_name + "." + filter_str.strip_edges().get_extension().to_lower();
|
||||
}
|
||||
file->set_text(file_str);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user