From 67e392de9e1d1122b9116f355d0ddfb4d0884233 Mon Sep 17 00:00:00 2001 From: Kaur Kuut Date: Fri, 25 Oct 2024 13:38:12 +0300 Subject: [PATCH] Update GTK file dialog filter equality comment. --- druid-shell/src/backend/gtk/dialog.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/druid-shell/src/backend/gtk/dialog.rs b/druid-shell/src/backend/gtk/dialog.rs index 43b4f926f..81152d2da 100644 --- a/druid-shell/src/backend/gtk/dialog.rs +++ b/druid-shell/src/backend/gtk/dialog.rs @@ -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; }