2006-11-16 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c: Provide a fast path returning
NULL when the limit is set to 0.
* gtk/gtkrecentchooserdefault.c:
* gtk/gtkrecentchoosermenu.c: Add the same fast path
inside the RecentChooser implementation; add a check
in the list clamping code. (#373466 and duplicates)
+2006-11-16 Emmanuele Bassi <ebassi@gnome.org>
+
+ * gtk/gtkrecentmanager.c: Provide a fast path returning
+ NULL when the limit is set to 0.
+
+ * gtk/gtkrecentchooserdefault.c:
+ * gtk/gtkrecentchoosermenu.c: Add the same fast path
+ inside the RecentChooser implementation; add a check
+ in the list clamping code. (#373466 and duplicates)
+
2006-11-15 Matthias Clasen <mclasen@redhat.com>
* modules/printbackends/cups/gtkprintbackendcups.c (cups_printer_get_options):
return NULL;
limit = gtk_recent_chooser_get_limit (chooser);
- sort_type = gtk_recent_chooser_get_sort_type (chooser);
+ if (limit == 0)
+ return NULL;
+ sort_type = gtk_recent_chooser_get_sort_type (chooser);
switch (sort_type)
{
case GTK_RECENT_SORT_NONE:
GList *clamp, *l;
clamp = g_list_nth (items, limit - 1);
+ if (!clamp)
+ return items;
l = clamp->next;
clamp->next = NULL;
return NULL;
limit = gtk_recent_chooser_get_limit (chooser);
- sort_type = gtk_recent_chooser_get_sort_type (chooser);
+ if (limit == 0)
+ return NULL;
+ sort_type = gtk_recent_chooser_get_sort_type (chooser);
switch (sort_type)
{
case GTK_RECENT_SORT_NONE:
GList *clamp, *l;
clamp = g_list_nth (items, limit - 1);
+ if (!clamp)
+ return items;
l = clamp->next;
clamp->next = NULL;
priv = manager->priv;
if (!priv->recent_items)
return NULL;
+
+ if (priv->limit == 0)
+ return NULL;
uris = g_bookmark_file_get_uris (priv->recent_items, &uris_len);
for (i = 0; i < uris_len; i++)