sort the list into MRU order on load.
2008-03-25 Sven Neumann <sven@gimp.org> * app/gui/gui-vtable.c (gui_recent_list_load): sort the list into MRU order on load. svn path=/trunk/; revision=25213
This commit is contained in:
committed by
Sven Neumann
parent
cf1e3e4525
commit
a0528d8f14
@ -620,6 +620,14 @@ gui_recent_list_add_uri (Gimp *gimp,
|
||||
uri, &recent);
|
||||
}
|
||||
|
||||
static gint
|
||||
gui_recent_list_compare (gconstpointer a,
|
||||
gconstpointer b)
|
||||
{
|
||||
return (gtk_recent_info_get_modified ((GtkRecentInfo *) a) -
|
||||
gtk_recent_info_get_modified ((GtkRecentInfo *) b));
|
||||
}
|
||||
|
||||
static void
|
||||
gui_recent_list_load (Gimp *gimp)
|
||||
{
|
||||
@ -633,6 +641,8 @@ gui_recent_list_load (Gimp *gimp)
|
||||
|
||||
items = gtk_recent_manager_get_items (gtk_recent_manager_get_default ());
|
||||
|
||||
items = g_list_sort (items, gui_recent_list_compare);
|
||||
|
||||
for (list = items; list; list = list->next)
|
||||
{
|
||||
GtkRecentInfo *info = list->data;
|
||||
@ -657,6 +667,5 @@ gui_recent_list_load (Gimp *gimp)
|
||||
|
||||
g_list_free (items);
|
||||
|
||||
gimp_list_reverse (GIMP_LIST (gimp->documents));
|
||||
gimp_container_thaw (gimp->documents);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user