summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2007-10-04 22:52:13 +0000
committerEmmanuele Bassi <ebassi@src.gnome.org>2007-10-04 22:52:13 +0000
commit43f5b189b71fb360a472526f2b25090857553c98 (patch)
treeea60f39dddfb325dc05e1b9f66bd612dedf26fbc /gtk
parentff6a2c55a129076a768945560ae2ca8bb2216eee (diff)
downloadgdk-pixbuf-43f5b189b71fb360a472526f2b25090857553c98.tar.gz
Iterate on the proxies we hold when we change the sorting function and the
2007-10-04 Emmanuele Bassi <ebassi@gnome.org> * gtk/gtkrecentaction.c: (gtk_recent_action_set_sort_func), (set_current_filter): Iterate on the proxies we hold when we change the sorting function and the filter. (gtk_recent_action_connect_proxy), (gtk_recent_action_create_menu): Set the GtkRecentChooser:filter property when we create/connect a proxy chooser. Thanks to Jonh Wendell for pointing this bug out on gtk-list. (gtk_recent_chooser_set_property): Bail out without iterating over the proxies when there's no need to. svn path=/trunk/; revision=18883
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkrecentaction.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/gtk/gtkrecentaction.c b/gtk/gtkrecentaction.c
index 70c0e2415..5beec74a4 100644
--- a/gtk/gtkrecentaction.c
+++ b/gtk/gtkrecentaction.c
@@ -192,6 +192,7 @@ gtk_recent_action_set_sort_func (GtkRecentChooser *chooser,
{
GtkRecentAction *action = GTK_RECENT_ACTION (chooser);
GtkRecentActionPrivate *priv = action->priv;
+ GSList *l;
if (priv->data_destroy)
{
@@ -208,6 +209,15 @@ gtk_recent_action_set_sort_func (GtkRecentChooser *chooser,
priv->sort_data = sort_data;
priv->data_destroy = data_destroy;
}
+
+ for (l = priv->choosers; l; l = l->next)
+ {
+ GtkRecentChooser *chooser_menu = l->data;
+
+ gtk_recent_chooser_set_sort_func (chooser_menu, priv->sort_func,
+ priv->sort_data,
+ priv->data_destroy);
+ }
}
static void
@@ -215,6 +225,7 @@ set_current_filter (GtkRecentAction *action,
GtkRecentFilter *filter)
{
GtkRecentActionPrivate *priv = action->priv;
+ GSList *l;
g_object_ref (action);
@@ -226,6 +237,13 @@ set_current_filter (GtkRecentAction *action,
if (priv->current_filter)
g_object_ref_sink (priv->current_filter);
+ for (l = priv->choosers; l; l = l->next)
+ {
+ GtkRecentChooser *chooser = l->data;
+
+ gtk_recent_chooser_set_filter (chooser, priv->current_filter);
+ }
+
g_object_notify (G_OBJECT (action), "filter");
g_object_unref (action);
@@ -331,6 +349,7 @@ gtk_recent_action_connect_proxy (GtkAction *action,
"show-numbers", priv->show_numbers,
"limit", priv->limit,
"sort-type", priv->sort_type,
+ "filter", priv->current_filter,
NULL);
if (priv->sort_func)
@@ -384,6 +403,7 @@ gtk_recent_action_create_menu (GtkAction *action)
"limit", priv->limit,
"sort-type", priv->sort_type,
"recent-manager", priv->manager,
+ "filter", priv->current_filter,
NULL);
if (priv->sort_func)
@@ -552,16 +572,21 @@ gtk_recent_action_set_property (GObject *gobject,
priv->sort_type = g_value_get_enum (value);
break;
case GTK_RECENT_CHOOSER_PROP_FILTER:
+ /* this already iterates over the choosers list */
set_current_filter (action, g_value_get_object (value));
- break;
+ return;
case GTK_RECENT_CHOOSER_PROP_SELECT_MULTIPLE:
g_warning ("%s: Choosers of type `%s' do not support selecting multiple items.",
G_STRFUNC,
G_OBJECT_TYPE_NAME (gobject));
- break;
+ return;
case GTK_RECENT_CHOOSER_PROP_RECENT_MANAGER:
+ /* this is a construct-only property; we set the recent-manager
+ * of the choosers with this value when we create them, so there's
+ * no need to iterate later.
+ */
set_recent_manager (action, g_value_get_object (value));
- break;
+ return;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
return;