summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2013-06-11 13:56:38 +0200
committerAlexander Larsson <alexl@redhat.com>2013-06-13 12:17:07 +0200
commit4a0b6e5479b1f678f257b28182aaa9c35151d038 (patch)
tree6a9893dddf3de5b9299edf3c78146179fce0a8b8
parentc6ac7115084f3efa98c3174f2aa1138e40e465cb (diff)
downloadgtk+-4a0b6e5479b1f678f257b28182aaa9c35151d038.tar.gz
GtkListBox: Remove refilter signal
This was added from https://bugzilla.gnome.org/show_bug.cgi?id=691979 where it was wanted in order to get a "all children filtered" kind of row. However, the solution is not really generic enough, because filtering can happen for other reasons than a full refilter (i.e. due to a row change), and the partial fix you can get by counting children after refilter can be achieved by manually doing it whenever you manually called refilter anyway. Its possible we should have some better solution for the "empty state" though.
-rw-r--r--gtk/gtklistbox.c23
-rw-r--r--gtk/gtklistbox.h1
2 files changed, 3 insertions, 21 deletions
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index 62598b3047..37e956be73 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -96,7 +96,6 @@ enum {
ACTIVATE_CURSOR_ROW,
TOGGLE_CURSOR_ROW,
MOVE_CURSOR,
- REFILTER,
LAST_SIGNAL
};
@@ -175,7 +174,6 @@ static void gtk_list_box_real_toggle_cursor_row (GtkListBo
static void gtk_list_box_real_move_cursor (GtkListBox *list_box,
GtkMovementStep step,
gint count);
-static void gtk_list_box_real_refilter (GtkListBox *list_box);
static void gtk_list_box_finalize (GObject *obj);
static void gtk_list_box_real_parent_set (GtkWidget *widget,
GtkWidget *prev_parent);
@@ -337,7 +335,6 @@ gtk_list_box_class_init (GtkListBoxClass *klass)
klass->activate_cursor_row = gtk_list_box_real_activate_cursor_row;
klass->toggle_cursor_row = gtk_list_box_real_toggle_cursor_row;
klass->move_cursor = gtk_list_box_real_move_cursor;
- klass->refilter = gtk_list_box_real_refilter;
properties[PROP_SELECTION_MODE] =
g_param_spec_enum ("selection-mode",
@@ -419,14 +416,6 @@ gtk_list_box_class_init (GtkListBoxClass *klass)
_gtk_marshal_VOID__ENUM_INT,
G_TYPE_NONE, 2,
GTK_TYPE_MOVEMENT_STEP, G_TYPE_INT);
- signals[REFILTER] =
- g_signal_new ("refilter",
- GTK_TYPE_LIST_BOX,
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GtkListBoxClass, refilter),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
widget_class->activate_signal = signals[ACTIVATE_CURSOR_ROW];
@@ -771,14 +760,6 @@ gtk_list_box_set_separator_func (GtkListBox *list_box,
gtk_list_box_reseparate (list_box);
}
-static void
-gtk_list_box_real_refilter (GtkListBox *list_box)
-{
- gtk_list_box_apply_filter_all (list_box);
- gtk_list_box_reseparate (list_box);
- gtk_widget_queue_resize (GTK_WIDGET (list_box));
-}
-
/**
* gtk_list_box_refilter:
* @list_box: a #GtkListBox
@@ -796,7 +777,9 @@ gtk_list_box_refilter (GtkListBox *list_box)
{
g_return_if_fail (list_box != NULL);
- g_signal_emit (list_box, signals[REFILTER], 0);
+ gtk_list_box_apply_filter_all (list_box);
+ gtk_list_box_reseparate (list_box);
+ gtk_widget_queue_resize (GTK_WIDGET (list_box));
}
static gint
diff --git a/gtk/gtklistbox.h b/gtk/gtklistbox.h
index df38082b06..ee49e08182 100644
--- a/gtk/gtklistbox.h
+++ b/gtk/gtklistbox.h
@@ -62,7 +62,6 @@ struct _GtkListBoxClass
void (*activate_cursor_row) (GtkListBox* list_box);
void (*toggle_cursor_row) (GtkListBox* list_box);
void (*move_cursor) (GtkListBox* list_box, GtkMovementStep step, gint count);
- void (*refilter) (GtkListBox* list_box);
/* Padding for future expansion */
void (*_gtk_reserved1) (void);