Skip to content

Commit

Permalink
Merge pull request #96203 from bruvzg/fd_all_filter
Browse files Browse the repository at this point in the history
[Linux] Fix "all files" filter in the native file dialog.
  • Loading branch information
akien-mga committed Aug 28, 2024
2 parents 35be8ac + 7b4e3e0 commit 108c603
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions platform/linuxbsd/freedesktop_portal_desktop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,17 +377,26 @@ Error FreeDesktopPortalDesktop::file_dialog_show(DisplayServer::WindowID p_windo
String flt = tokens[0].strip_edges();
if (!flt.is_empty()) {
if (tokens.size() == 2) {
filter_exts.push_back(flt);
if (flt == "*.*") {
filter_exts.push_back("*");
} else {
filter_exts.push_back(flt);
}
filter_names.push_back(tokens[1]);
} else {
filter_exts.push_back(flt);
filter_names.push_back(flt);
if (flt == "*.*") {
filter_exts.push_back("*");
filter_names.push_back(RTR("All Files"));
} else {
filter_exts.push_back(flt);
filter_names.push_back(flt);
}
}
}
}
}
if (filter_names.is_empty()) {
filter_exts.push_back("*.*");
filter_exts.push_back("*");
filter_names.push_back(RTR("All Files"));
}

Expand Down

0 comments on commit 108c603

Please sign in to comment.