summaryrefslogtreecommitdiff
path: root/demos/gtk-demo/listview_words.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2020-07-12 07:02:04 +0200
committerBenjamin Otte <otte@redhat.com>2020-07-16 20:43:16 +0200
commite518c1f2f32a50b3c2907208634ce7ee43fffa7b (patch)
treed9ac15d98445641ec43f3957292d25c224dc5be5 /demos/gtk-demo/listview_words.c
parentc5ea59d7d11e5b9484acc0aa30dd12a434ff7966 (diff)
downloadgtk+-e518c1f2f32a50b3c2907208634ce7ee43fffa7b.tar.gz
stringfilter: Make the constructor take an expression
An expression is critically important for a string filter and people should be made aware of it when constructing the filter.
Diffstat (limited to 'demos/gtk-demo/listview_words.c')
-rw-r--r--demos/gtk-demo/listview_words.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/demos/gtk-demo/listview_words.c b/demos/gtk-demo/listview_words.c
index be556696cf..95664ed279 100644
--- a/demos/gtk-demo/listview_words.c
+++ b/demos/gtk-demo/listview_words.c
@@ -160,7 +160,6 @@ do_listview_words (GtkWidget *do_widget)
GtkNoSelection *selection;
GtkStringList *stringlist;
GtkFilter *filter;
- GtkExpression *expression;
GFile *file;
file = g_file_new_for_path ("/usr/share/dict/words");
@@ -177,10 +176,7 @@ do_listview_words (GtkWidget *do_widget)
g_strfreev (words);
}
- filter = gtk_string_filter_new ();
- expression = gtk_property_expression_new (GTK_TYPE_STRING_OBJECT, NULL, "string");
- gtk_string_filter_set_expression (GTK_STRING_FILTER (filter), expression);
- gtk_expression_unref (expression);
+ filter = gtk_string_filter_new (gtk_property_expression_new (GTK_TYPE_STRING_OBJECT, NULL, "string"));
filter_model = gtk_filter_list_model_new (G_LIST_MODEL (stringlist), filter);
gtk_filter_list_model_set_incremental (filter_model, TRUE);