Skip to content

Commit

Permalink
Update GTK file dialog filter equality comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
xStrom committed Oct 25, 2024
1 parent d6b4538 commit 67e392d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions druid-shell/src/backend/gtk/dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,12 @@ pub(crate) fn get_file_dialog_path(
if let Some(file_types) = &options.allowed_types {
for f in file_types {
let filter = file_filter(f);
// We need to clone filter, because we may need it again for the default filter.
// It has to be the same FileFilter instance and can't be a new file_filter() call.
dialog.add_filter(filter.clone());

if let Some(default) = &options.default_type {
if default == f {
// Note that we're providing the same FileFilter object to
// add_filter and set_filter, because gtk checks them for
// identity, not structural equality.
dialog.set_filter(&filter);
found_default_filter = true;
}
Expand Down

0 comments on commit 67e392d

Please sign in to comment.