[gtk/wip/otte/listview: 5/138] filterlistmodel: Rewrite to use GtkFilter
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/listview: 5/138] filterlistmodel: Rewrite to use GtkFilter
- Date: Tue, 26 Nov 2019 15:52:38 +0000 (UTC)
commit 8452268cafb4d6c3d9f4ed82dec99321ab1556e7
Author: Benjamin Otte <otte redhat com>
Date: Sun Nov 10 02:39:31 2019 +0100
filterlistmodel: Rewrite to use GtkFilter
demos/constraint-editor/constraint-view.c | 9 +-
docs/reference/gtk/gtk4-sections.txt | 5 +-
gtk/gtkfilterlistmodel.c | 195 +++++++++++++-----------------
gtk/gtkfilterlistmodel.h | 18 +--
gtk/inspector/object-tree.c | 6 +-
testsuite/gtk/filterlistmodel.c | 74 +++++++++---
6 files changed, 161 insertions(+), 146 deletions(-)
---
diff --git a/demos/constraint-editor/constraint-view.c b/demos/constraint-editor/constraint-view.c
index 982338c93d..6d175382ef 100644
--- a/demos/constraint-editor/constraint-view.c
+++ b/demos/constraint-editor/constraint-view.c
@@ -169,6 +169,7 @@ constraint_view_init (ConstraintView *self)
GListModel *guides;
GListModel *children;
GListModel *constraints;
+ GtkFilter *filter;
manager = gtk_constraint_layout_new ();
gtk_widget_set_layout_manager (GTK_WIDGET (self), manager);
@@ -176,8 +177,12 @@ constraint_view_init (ConstraintView *self)
all_children = gtk_widget_observe_children (GTK_WIDGET (self));
all_constraints = gtk_constraint_layout_observe_constraints (GTK_CONSTRAINT_LAYOUT (manager));
guides = gtk_constraint_layout_observe_guides (GTK_CONSTRAINT_LAYOUT (manager));
- constraints = (GListModel *)gtk_filter_list_model_new (all_constraints, omit_internal, NULL, NULL);
- children = (GListModel *)gtk_filter_list_model_new (all_children, omit_internal, NULL, NULL);
+ filter = gtk_custom_filter_new (omit_internal, NULL, NULL);
+ constraints = (GListModel *)gtk_filter_list_model_new (all_constraints, filter);
+ g_object_unref (filter);
+ filter = gtk_custom_filter_new (omit_internal, NULL, NULL);
+ children = (GListModel *)gtk_filter_list_model_new (all_children, filter);
+ g_object_unref (filter);
list = g_list_store_new (G_TYPE_LIST_MODEL);
g_list_store_append (list, children);
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index f65b2b8b81..0155953433 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -1397,9 +1397,8 @@ gtk_filter_list_model_new
gtk_filter_list_model_new_for_type
gtk_filter_list_model_set_model
gtk_filter_list_model_get_model
-gtk_filter_list_model_set_filter_func
-gtk_filter_list_model_has_filter
-gtk_filter_list_model_refilter
+gtk_filter_list_model_set_filter
+gtk_filter_list_model_get_filter
<SUBSECTION Standard>
GTK_FILTER_LIST_MODEL
GTK_IS_FILTER_LIST_MODEL
diff --git a/gtk/gtkfilterlistmodel.c b/gtk/gtkfilterlistmodel.c
index 493c893f32..4bf2f88773 100644
--- a/gtk/gtkfilterlistmodel.c
+++ b/gtk/gtkfilterlistmodel.c
@@ -39,7 +39,7 @@
enum {
PROP_0,
- PROP_HAS_FILTER,
+ PROP_FILTER,
PROP_ITEM_TYPE,
PROP_MODEL,
NUM_PROPERTIES
@@ -65,9 +65,7 @@ struct _GtkFilterListModel
GType item_type;
GListModel *model;
- GtkFilterListModelFilterFunc filter_func;
- gpointer user_data;
- GDestroyNotify user_destroy;
+ GtkFilter *filter;
GtkRbTree *items; /* NULL if filter_func == NULL */
};
@@ -230,8 +228,11 @@ gtk_filter_list_model_run_filter (GtkFilterListModel *self,
gpointer item;
gboolean visible;
+ if (self->filter == NULL)
+ return TRUE;
+
item = g_list_model_get_item (self->model, position);
- visible = self->filter_func (item, self->user_data);
+ visible = gtk_filter_filter (self->filter, item);
g_object_unref (item);
return visible;
@@ -303,6 +304,10 @@ gtk_filter_list_model_set_property (GObject *object,
switch (prop_id)
{
+ case PROP_FILTER:
+ gtk_filter_list_model_set_filter (self, g_value_get_object (value));
+ break;
+
case PROP_ITEM_TYPE:
self->item_type = g_value_get_gtype (value);
break;
@@ -327,8 +332,8 @@ gtk_filter_list_model_get_property (GObject *object,
switch (prop_id)
{
- case PROP_HAS_FILTER:
- g_value_set_boolean (value, self->items != NULL);
+ case PROP_FILTER:
+ g_value_set_object (value, self->filter);
break;
case PROP_ITEM_TYPE:
@@ -357,17 +362,35 @@ gtk_filter_list_model_clear_model (GtkFilterListModel *self)
gtk_rb_tree_remove_all (self->items);
}
+static void
+gtk_filter_list_model_refilter (GtkFilterListModel *self);
+
+static void
+gtk_filter_list_model_filter_changed_cb (GtkFilter *filter,
+ GtkFilterChange change,
+ GtkFilterListModel *self)
+{
+ /* FIXME: Look at the change here */
+ gtk_filter_list_model_refilter (self);
+}
+
+static void
+gtk_filter_list_model_clear_filter (GtkFilterListModel *self)
+{
+ if (self->filter == NULL)
+ return;
+
+ g_signal_handlers_disconnect_by_func (self->filter, gtk_filter_list_model_filter_changed_cb, self);
+ g_clear_object (&self->filter);
+}
+
static void
gtk_filter_list_model_dispose (GObject *object)
{
GtkFilterListModel *self = GTK_FILTER_LIST_MODEL (object);
gtk_filter_list_model_clear_model (self);
- if (self->user_destroy)
- self->user_destroy (self->user_data);
- self->filter_func = NULL;
- self->user_data = NULL;
- self->user_destroy = NULL;
+ gtk_filter_list_model_clear_filter (self);
g_clear_pointer (&self->items, gtk_rb_tree_unref);
G_OBJECT_CLASS (gtk_filter_list_model_parent_class)->dispose (object);
@@ -383,16 +406,16 @@ gtk_filter_list_model_class_init (GtkFilterListModelClass *class)
gobject_class->dispose = gtk_filter_list_model_dispose;
/**
- * GtkFilterListModel:has-filter:
+ * GtkFilterListModel:filter:
*
- * If a filter is set for this model
+ * The filter for this model
*/
- properties[PROP_HAS_FILTER] =
- g_param_spec_boolean ("has-filter",
- P_("has filter"),
- P_("If a filter is set for this model"),
- FALSE,
- GTK_PARAM_READABLE | G_PARAM_EXPLICIT_NOTIFY);
+ properties[PROP_FILTER] =
+ g_param_spec_object ("filter",
+ P_("Filter"),
+ P_("The filter set for this model"),
+ GTK_TYPE_FILTER,
+ GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkFilterListModel:item-type:
@@ -421,12 +444,6 @@ gtk_filter_list_model_class_init (GtkFilterListModelClass *class)
g_object_class_install_properties (gobject_class, NUM_PROPERTIES, properties);
}
-static void
-gtk_filter_list_model_init (GtkFilterListModel *self)
-{
-}
-
-
static void
gtk_filter_list_model_augment (GtkRbTree *filter,
gpointer _aug,
@@ -454,23 +471,28 @@ gtk_filter_list_model_augment (GtkRbTree *filter,
}
}
+static void
+gtk_filter_list_model_init (GtkFilterListModel *self)
+{
+ self->items = gtk_rb_tree_new (FilterNode,
+ FilterAugment,
+ gtk_filter_list_model_augment,
+ NULL, NULL);
+}
+
/**
* gtk_filter_list_model_new:
* @model: the model to sort
- * @filter_func: (allow-none): filter function or %NULL to not filter items
- * @user_data: user data passed to @filter_func
- * @user_destroy: destroy notifier for @user_data
+ * @filter: (allow-none): filter or %NULL to not filter items
*
* Creates a new #GtkFilterListModel that will filter @model using the given
- * @filter_func.
+ * @filter.
*
* Returns: a new #GtkFilterListModel
**/
GtkFilterListModel *
-gtk_filter_list_model_new (GListModel *model,
- GtkFilterListModelFilterFunc filter_func,
- gpointer user_data,
- GDestroyNotify user_destroy)
+gtk_filter_list_model_new (GListModel *model,
+ GtkFilter *filter)
{
GtkFilterListModel *result;
@@ -479,11 +501,9 @@ gtk_filter_list_model_new (GListModel *model,
result = g_object_new (GTK_TYPE_FILTER_LIST_MODEL,
"item-type", g_list_model_get_item_type (model),
"model", model,
+ "filter", filter,
NULL);
- if (filter_func)
- gtk_filter_list_model_set_filter_func (result, filter_func, user_data, user_destroy);
-
return result;
}
@@ -508,66 +528,50 @@ gtk_filter_list_model_new_for_type (GType item_type)
}
/**
- * gtk_filter_list_model_set_filter_func:
+ * gtk_filter_list_model_set_filter:
* @self: a #GtkFilterListModel
- * @filter_func: (allow-none): filter function or %NULL to not filter items
- * @user_data: user data passed to @filter_func
- * @user_destroy: destroy notifier for @user_data
+ * @filter: (allow-none) (transfer none): filter to use or %NULL to not filter items
*
- * Sets the function used to filter items. The function will be called for every
- * item and if it returns %TRUE the item is considered visible.
+ * Sets the filter used to filter items.
**/
void
-gtk_filter_list_model_set_filter_func (GtkFilterListModel *self,
- GtkFilterListModelFilterFunc filter_func,
- gpointer user_data,
- GDestroyNotify user_destroy)
+gtk_filter_list_model_set_filter (GtkFilterListModel *self,
+ GtkFilter *filter)
{
- gboolean was_filtered, will_be_filtered;
-
g_return_if_fail (GTK_IS_FILTER_LIST_MODEL (self));
- g_return_if_fail (filter_func != NULL || (user_data == NULL && !user_destroy));
+ g_return_if_fail (filter == NULL || GTK_IS_FILTER (filter));
- was_filtered = self->filter_func != NULL;
- will_be_filtered = filter_func != NULL;
-
- if (!was_filtered && !will_be_filtered)
+ if (self->filter == filter)
return;
- if (self->user_destroy)
- self->user_destroy (self->user_data);
+ gtk_filter_list_model_clear_filter (self);
- self->filter_func = filter_func;
- self->user_data = user_data;
- self->user_destroy = user_destroy;
-
- if (!will_be_filtered)
+ if (filter)
{
- g_clear_pointer (&self->items, gtk_rb_tree_unref);
- }
- else if (!was_filtered)
- {
- guint i, n_items;
-
- self->items = gtk_rb_tree_new (FilterNode,
- FilterAugment,
- gtk_filter_list_model_augment,
- NULL, NULL);
- if (self->model)
- {
- n_items = g_list_model_get_n_items (self->model);
- for (i = 0; i < n_items; i++)
- {
- FilterNode *node = gtk_rb_tree_insert_before (self->items, NULL);
- node->visible = TRUE;
- }
- }
+ self->filter = g_object_ref (filter);
+ g_signal_connect (filter, "changed", G_CALLBACK (gtk_filter_list_model_filter_changed_cb), self);
}
gtk_filter_list_model_refilter (self);
- if (was_filtered != will_be_filtered)
- g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_HAS_FILTER]);
+ g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_FILTER]);
+}
+
+/**
+ * gtk_filter_list_model_get_filter:
+ * @self: a #GtkFilterListModel
+ *
+ * Gets the #GtkFilter currently set on @self.
+ *
+ * Returns: (nullable) (transfer none): The filter currently in use
+ * or %NULL if the list isn't filtered
+ **/
+GtkFilter *
+gtk_filter_list_model_get_filter (GtkFilterListModel *self)
+{
+ g_return_val_if_fail (GTK_IS_FILTER_LIST_MODEL (self), FALSE);
+
+ return self->filter;
}
/**
@@ -633,32 +637,7 @@ gtk_filter_list_model_get_model (GtkFilterListModel *self)
return self->model;
}
-/**
- * gtk_filter_list_model_has_filter:
- * @self: a #GtkFilterListModel
- *
- * Checks if a filter function is currently set on @self
- *
- * Returns: %TRUE if a filter function is set
- **/
-gboolean
-gtk_filter_list_model_has_filter (GtkFilterListModel *self)
-{
- g_return_val_if_fail (GTK_IS_FILTER_LIST_MODEL (self), FALSE);
-
- return self->filter_func != NULL;
-}
-
-/**
- * gtk_filter_list_model_refilter:
- * @self: a #GtkFilterListModel
- *
- * Causes @self to refilter all items in the model.
- *
- * Calling this function is necessary when data used by the filter
- * function has changed.
- **/
-void
+static void
gtk_filter_list_model_refilter (GtkFilterListModel *self)
{
FilterNode *node;
diff --git a/gtk/gtkfilterlistmodel.h b/gtk/gtkfilterlistmodel.h
index e1f256ac2d..17e295e613 100644
--- a/gtk/gtkfilterlistmodel.h
+++ b/gtk/gtkfilterlistmodel.h
@@ -26,6 +26,7 @@
#endif
#include <gio/gio.h>
+#include <gtk/gtkfilter.h>
#include <gtk/gtkwidget.h>
@@ -51,27 +52,20 @@ typedef gboolean (* GtkFilterListModelFilterFunc) (gpointer item, gpointer user_
GDK_AVAILABLE_IN_ALL
GtkFilterListModel * gtk_filter_list_model_new (GListModel *model,
- GtkFilterListModelFilterFunc filter_func,
- gpointer user_data,
- GDestroyNotify user_destroy);
+ GtkFilter *filter);
GDK_AVAILABLE_IN_ALL
GtkFilterListModel * gtk_filter_list_model_new_for_type (GType item_type);
GDK_AVAILABLE_IN_ALL
-void gtk_filter_list_model_set_filter_func (GtkFilterListModel *self,
- GtkFilterListModelFilterFunc filter_func,
- gpointer user_data,
- GDestroyNotify user_destroy);
+void gtk_filter_list_model_set_filter (GtkFilterListModel *self,
+ GtkFilter *filter);
+GDK_AVAILABLE_IN_ALL
+GtkFilter * gtk_filter_list_model_get_filter (GtkFilterListModel *self);
GDK_AVAILABLE_IN_ALL
void gtk_filter_list_model_set_model (GtkFilterListModel *self,
GListModel *model);
GDK_AVAILABLE_IN_ALL
GListModel * gtk_filter_list_model_get_model (GtkFilterListModel *self);
-GDK_AVAILABLE_IN_ALL
-gboolean gtk_filter_list_model_has_filter (GtkFilterListModel *self);
-
-GDK_AVAILABLE_IN_ALL
-void gtk_filter_list_model_refilter (GtkFilterListModel *self);
G_END_DECLS
diff --git a/gtk/inspector/object-tree.c b/gtk/inspector/object-tree.c
index d8b52864b8..4a76a4a38c 100644
--- a/gtk/inspector/object-tree.c
+++ b/gtk/inspector/object-tree.c
@@ -35,6 +35,7 @@
#include "gtkcelllayout.h"
#include "gtkcomboboxprivate.h"
#include "gtkfilterlistmodel.h"
+#include "gtkfilters.h"
#include "gtkflattenlistmodel.h"
#include "gtkiconprivate.h"
#include "gtkiconview.h"
@@ -1128,6 +1129,7 @@ toplevel_filter_func (gpointer item,
static GListModel *
create_root_model (void)
{
+ GtkFilter *custom_filter;
GtkFilterListModel *filter;
GtkFlattenListModel *flatten;
GListStore *list, *special;
@@ -1144,10 +1146,10 @@ create_root_model (void)
g_object_unref (special);
filter = gtk_filter_list_model_new_for_type (G_TYPE_OBJECT);
- gtk_filter_list_model_set_filter_func (filter,
- toplevel_filter_func,
+ custom_filter = gtk_custom_filter_new (toplevel_filter_func,
g_object_ref (gdk_display_get_default ()),
g_object_unref);
+ gtk_filter_list_model_set_filter (filter, custom_filter);
gtk_filter_list_model_set_model (filter, gtk_window_get_toplevels ());
g_list_store_append (list, filter);
g_object_unref (filter);
diff --git a/testsuite/gtk/filterlistmodel.c b/testsuite/gtk/filterlistmodel.c
index 6cd9111255..a6311328c9 100644
--- a/testsuite/gtk/filterlistmodel.c
+++ b/testsuite/gtk/filterlistmodel.c
@@ -152,9 +152,15 @@ new_model (guint size,
gpointer data)
{
GtkFilterListModel *result;
+ GtkFilter *filter;
GString *changes;
- result = gtk_filter_list_model_new (G_LIST_MODEL (new_store (1, size, 1)), filter_func, data, NULL);
+ if (filter_func)
+ filter = gtk_custom_filter_new (filter_func, data, NULL);
+ else
+ filter = NULL;
+ result = gtk_filter_list_model_new (G_LIST_MODEL (new_store (1, size, 1)), filter);
+ g_clear_object (&filter);
changes = g_string_new ("");
g_object_set_qdata_full (G_OBJECT(result), changes_quark, changes, free_changes);
g_signal_connect (result, "items-changed", G_CALLBACK (items_changed), changes);
@@ -217,89 +223,119 @@ test_create (void)
}
static void
-test_empty_set_filter_func (void)
+test_empty_set_filter (void)
{
GtkFilterListModel *filter;
+ GtkFilter *custom;
filter = new_model (10, NULL, NULL);
- gtk_filter_list_model_set_filter_func (filter, is_smaller_than, GUINT_TO_POINTER (20), NULL);
+ custom = gtk_custom_filter_new (is_smaller_than, GUINT_TO_POINTER (20), NULL);
+ gtk_filter_list_model_set_filter (filter, custom);
+ g_object_unref (custom);
assert_model (filter, "1 2 3 4 5 6 7 8 9 10");
assert_changes (filter, "");
g_object_unref (filter);
filter = new_model (10, NULL, NULL);
- gtk_filter_list_model_set_filter_func (filter, is_smaller_than, GUINT_TO_POINTER (7), NULL);
+ custom = gtk_custom_filter_new (is_smaller_than, GUINT_TO_POINTER (7), NULL);
+ gtk_filter_list_model_set_filter (filter, custom);
+ g_object_unref (custom);
assert_model (filter, "1 2 3 4 5 6");
assert_changes (filter, "6-4");
g_object_unref (filter);
filter = new_model (10, NULL, NULL);
- gtk_filter_list_model_set_filter_func (filter, is_smaller_than, GUINT_TO_POINTER (0), NULL);
+ custom = gtk_custom_filter_new (is_smaller_than, GUINT_TO_POINTER (0), NULL);
+ gtk_filter_list_model_set_filter (filter, custom);
+ g_object_unref (custom);
assert_model (filter, "");
assert_changes (filter, "0-10");
g_object_unref (filter);
filter = new_model (10, NULL, NULL);
- gtk_filter_list_model_set_filter_func (filter, is_larger_than, GUINT_TO_POINTER (0), NULL);
+ custom = gtk_custom_filter_new (is_larger_than, GUINT_TO_POINTER (0), NULL);
+ gtk_filter_list_model_set_filter (filter, custom);
+ g_object_unref (custom);
assert_model (filter, "1 2 3 4 5 6 7 8 9 10");
assert_changes (filter, "");
g_object_unref (filter);
filter = new_model (10, NULL, NULL);
- gtk_filter_list_model_set_filter_func (filter, is_larger_than, GUINT_TO_POINTER (3), NULL);
+ custom = gtk_custom_filter_new (is_larger_than, GUINT_TO_POINTER (3), NULL);
+ gtk_filter_list_model_set_filter (filter, custom);
+ g_object_unref (custom);
assert_model (filter, "4 5 6 7 8 9 10");
assert_changes (filter, "0-3");
g_object_unref (filter);
filter = new_model (10, NULL, NULL);
- gtk_filter_list_model_set_filter_func (filter, is_larger_than, GUINT_TO_POINTER (20), NULL);
+ custom = gtk_custom_filter_new (is_larger_than, GUINT_TO_POINTER (20), NULL);
+ gtk_filter_list_model_set_filter (filter, custom);
+ g_object_unref (custom);
assert_model (filter, "");
assert_changes (filter, "0-10");
g_object_unref (filter);
filter = new_model (10, NULL, NULL);
- gtk_filter_list_model_set_filter_func (filter, is_near, GUINT_TO_POINTER (5), NULL);
+ custom = gtk_custom_filter_new (is_near, GUINT_TO_POINTER (5), NULL);
+ gtk_filter_list_model_set_filter (filter, custom);
+ g_object_unref (custom);
assert_model (filter, "3 4 5 6 7");
assert_changes (filter, "0-10+5");
g_object_unref (filter);
filter = new_model (10, NULL, NULL);
- gtk_filter_list_model_set_filter_func (filter, is_not_near, GUINT_TO_POINTER (5), NULL);
+ custom = gtk_custom_filter_new (is_not_near, GUINT_TO_POINTER (5), NULL);
+ gtk_filter_list_model_set_filter (filter, custom);
+ g_object_unref (custom);
assert_model (filter, "1 2 8 9 10");
assert_changes (filter, "2-5");
g_object_unref (filter);
}
static void
-test_change_filter_func (void)
+test_change_filter (void)
{
GtkFilterListModel *filter;
+ GtkFilter *custom;
filter = new_model (10, is_not_near, GUINT_TO_POINTER (5));
assert_model (filter, "1 2 8 9 10");
assert_changes (filter, "");
- gtk_filter_list_model_set_filter_func (filter, is_not_near, GUINT_TO_POINTER (6), NULL);
+ custom = gtk_custom_filter_new (is_not_near, GUINT_TO_POINTER (6), NULL);
+ gtk_filter_list_model_set_filter (filter, custom);
+ g_object_unref (custom);
assert_model (filter, "1 2 3 9 10");
assert_changes (filter, "2-1+1");
- gtk_filter_list_model_set_filter_func (filter, is_not_near, GUINT_TO_POINTER (9), NULL);
+ custom = gtk_custom_filter_new (is_not_near, GUINT_TO_POINTER (9), NULL);
+ gtk_filter_list_model_set_filter (filter, custom);
+ g_object_unref (custom);
assert_model (filter, "1 2 3 4 5 6");
assert_changes (filter, "3-2+3");
- gtk_filter_list_model_set_filter_func (filter, is_smaller_than, GUINT_TO_POINTER (6), NULL);
+ custom = gtk_custom_filter_new (is_smaller_than, GUINT_TO_POINTER (6), NULL);
+ gtk_filter_list_model_set_filter (filter, custom);
+ g_object_unref (custom);
assert_model (filter, "1 2 3 4 5");
assert_changes (filter, "-5");
- gtk_filter_list_model_set_filter_func (filter, is_larger_than, GUINT_TO_POINTER (4), NULL);
+ custom = gtk_custom_filter_new (is_larger_than, GUINT_TO_POINTER (4), NULL);
+ gtk_filter_list_model_set_filter (filter, custom);
+ g_object_unref (custom);
assert_model (filter, "5 6 7 8 9 10");
assert_changes (filter, "0-5+6");
- gtk_filter_list_model_set_filter_func (filter, is_not_near, GUINT_TO_POINTER (2), NULL);
+ custom = gtk_custom_filter_new (is_not_near, GUINT_TO_POINTER (2), NULL);
+ gtk_filter_list_model_set_filter (filter, custom);
+ g_object_unref (custom);
assert_model (filter, "5 6 7 8 9 10");
assert_changes (filter, "");
- gtk_filter_list_model_set_filter_func (filter, is_not_near, GUINT_TO_POINTER (4), NULL);
+ custom = gtk_custom_filter_new (is_not_near, GUINT_TO_POINTER (4), NULL);
+ gtk_filter_list_model_set_filter (filter, custom);
+ g_object_unref (custom);
assert_model (filter, "1 7 8 9 10");
assert_changes (filter, "0-2+1");
@@ -316,8 +352,8 @@ main (int argc, char *argv[])
changes_quark = g_quark_from_static_string ("What did I see? Can I believe what I saw?");
g_test_add_func ("/filterlistmodel/create", test_create);
- g_test_add_func ("/filterlistmodel/empty_set_filter_func", test_empty_set_filter_func);
- g_test_add_func ("/filterlistmodel/change_filter_func", test_change_filter_func);
+ g_test_add_func ("/filterlistmodel/empty_set_filter", test_empty_set_filter);
+ g_test_add_func ("/filterlistmodel/change_filter", test_change_filter);
return g_test_run ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]