diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-08-03 15:04:33 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-09-05 21:43:42 -0400 |
commit | dfabe74c593b876f50e56903e6c5f7f11f332781 (patch) | |
tree | d66e52265919a29d0f376f855ac22e30a8593260 /gtk/gtkprintunixdialog.c | |
parent | 716c7b2f217b9852fa446b4566180ae10f48f618 (diff) | |
download | gtk+-dfabe74c593b876f50e56903e6c5f7f11f332781.tar.gz |
Make filter constructors return exact types
Make functions like gtk_custom_filter_new() return
the actual type they construct.
Update all callers.
Diffstat (limited to 'gtk/gtkprintunixdialog.c')
-rw-r--r-- | gtk/gtkprintunixdialog.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c index e078114b02..f4bdaa0f04 100644 --- a/gtk/gtkprintunixdialog.c +++ b/gtk/gtkprintunixdialog.c @@ -742,7 +742,8 @@ gtk_print_unix_dialog_init (GtkPrintUnixDialog *dialog) GListModel *selection; GtkSorter *sorter; GtkFilter *filter; - GtkFilter *filter1; + GtkStringFilter *filter1; + GtkCustomFilter *filter2; GtkListItemFactory *factory; GListStore *store; GListModel *paper_size_list; @@ -813,19 +814,19 @@ gtk_print_unix_dialog_init (GtkPrintUnixDialog *dialog) sorter = gtk_custom_sorter_new (default_printer_list_sort_func, NULL, NULL); sorted = G_LIST_MODEL (gtk_sort_list_model_new (model, sorter)); - filter = gtk_every_filter_new (); + filter = GTK_FILTER (gtk_every_filter_new ()); filter1 = gtk_string_filter_new ( gtk_cclosure_expression_new (G_TYPE_STRING, NULL, 0, NULL, G_CALLBACK (get_printer_key), NULL, NULL)); - gtk_string_filter_set_match_mode (GTK_STRING_FILTER (filter1), GTK_STRING_FILTER_MATCH_MODE_SUBSTRING); - gtk_string_filter_set_ignore_case (GTK_STRING_FILTER (filter1), TRUE); - gtk_multi_filter_append (GTK_MULTI_FILTER (filter), filter1); + gtk_string_filter_set_match_mode (filter1, GTK_STRING_FILTER_MATCH_MODE_SUBSTRING); + gtk_string_filter_set_ignore_case (filter1, TRUE); + gtk_multi_filter_append (GTK_MULTI_FILTER (filter), GTK_FILTER (filter1)); - filter1 = gtk_custom_filter_new (is_printer_active, dialog, NULL); - gtk_multi_filter_append (GTK_MULTI_FILTER (filter), filter1); + filter2 = gtk_custom_filter_new (is_printer_active, dialog, NULL); + gtk_multi_filter_append (GTK_MULTI_FILTER (filter), GTK_FILTER (filter2)); filtered = G_LIST_MODEL (gtk_filter_list_model_new (sorted, filter)); |