+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.
+
2007-10-04 Matthias Clasen <mclasen@redhat.com>
* tests/testvolumebutton.c: Add a second volume button.
{
GtkRecentAction *action = GTK_RECENT_ACTION (chooser);
GtkRecentActionPrivate *priv = action->priv;
+ GSList *l;
if (priv->data_destroy)
{
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
GtkRecentFilter *filter)
{
GtkRecentActionPrivate *priv = action->priv;
+ GSList *l;
g_object_ref (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);
"show-numbers", priv->show_numbers,
"limit", priv->limit,
"sort-type", priv->sort_type,
+ "filter", priv->current_filter,
NULL);
if (priv->sort_func)
"limit", priv->limit,
"sort-type", priv->sort_type,
"recent-manager", priv->manager,
+ "filter", priv->current_filter,
NULL);
if (priv->sort_func)
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;