diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-07-03 13:40:58 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-07-05 12:36:47 -0400 |
commit | acccac516e144afc4e5dac9808d32dc91999d23e (patch) | |
tree | dbd916209f1da762d556926b1688161284e2e2a7 /tests | |
parent | d65214fa4e8dee5df735d6a43bb85825823f1e18 (diff) | |
download | gtk+-acccac516e144afc4e5dac9808d32dc91999d23e.tar.gz |
filefiler: No more floating
Make GtkFileFilter not be initially unowned anymore.
This is in preparation for deriving GtkFileFilter
from GtkFilter. Update all callers.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testfilechooser.c | 5 | ||||
-rw-r--r-- | tests/testgtk.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/testfilechooser.c b/tests/testfilechooser.c index 71c0358af3..1dca027ecc 100644 --- a/tests/testfilechooser.c +++ b/tests/testfilechooser.c @@ -393,6 +393,7 @@ main (int argc, char **argv) /* Make this filter the default */ gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), filter); + g_object_unref (filter); filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, "No backup files"); @@ -400,11 +401,13 @@ main (int argc, char **argv) no_backup_files_filter, NULL, NULL); gtk_file_filter_add_mime_type (filter, "image/png"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); + g_object_unref (filter); filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, "Starts with D"); gtk_file_filter_add_pattern (filter, "D*"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); + g_object_unref (filter); g_signal_connect (dialog, "notify::filter", G_CALLBACK (filter_changed), NULL); @@ -414,11 +417,13 @@ main (int argc, char **argv) gtk_file_filter_add_mime_type (filter, "image/jpeg"); gtk_file_filter_add_mime_type (filter, "image/png"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); + g_object_unref (filter); filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, "Images"); gtk_file_filter_add_pixbuf_formats (filter); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); + g_object_unref (filter); /* Choices */ diff --git a/tests/testgtk.c b/tests/testgtk.c index 791ea10f46..10507a3f3a 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -5692,17 +5692,20 @@ native_filter_changed (GtkWidget *combo, gtk_file_filter_add_pattern (filter, "*.doc"); gtk_file_filter_add_pattern (filter, "*.txt"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (native), filter); + g_object_unref (filter); filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, "Images"); gtk_file_filter_add_pixbuf_formats (filter); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (native), filter); gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (native), filter); + g_object_unref (filter); filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, "All"); gtk_file_filter_add_pattern (filter, "*"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (native), filter); + g_object_unref (filter); break; case 2: /* mimetype */ @@ -5710,12 +5713,14 @@ native_filter_changed (GtkWidget *combo, gtk_file_filter_set_name (filter, "Text"); gtk_file_filter_add_mime_type (filter, "text/plain"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (native), filter); + g_object_unref (filter); filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, "All"); gtk_file_filter_add_pattern (filter, "*"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (native), filter); gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (native), filter); + g_object_unref (filter); break; default: g_assert_not_reached (); |