From 6f1d571c04b1d8aa4ec28059e6560983c9bb8d6a Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 3 Jan 2008 12:29:16 +0000 Subject: [PATCH] Use the correct comparison function (kudos to Christian Persch and Claudio 2008-01-03 Emmanuele Bassi * gtk/gtkfilechooserdefault.c (recent_sort_mru): Use the correct comparison function (kudos to Christian Persch and Claudio Saavedra for spotting this) * gtk/gtkrecentchooserutils.c: (sort_recent_items_mru), (sort_recent_items_lru): Ditto as above. svn path=/trunk/; revision=19302 --- ChangeLog | 10 ++++++++++ gtk/gtkfilechooserdefault.c | 2 +- gtk/gtkrecentchooserutils.c | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e7d9a969f..af7f2c491 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-01-03 Emmanuele Bassi + + * gtk/gtkfilechooserdefault.c (recent_sort_mru): Use the + correct comparison function (kudos to Christian Persch and + Claudio Saavedra for spotting this) + + * gtk/gtkrecentchooserutils.c: + (sort_recent_items_mru), + (sort_recent_items_lru): Ditto as above. + 2008-01-03 Johan Dahlin * tests/defaultvaluetest.c: Make it pass again. diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 75a149f0e..46892cacb 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -9850,7 +9850,7 @@ recent_sort_mru (gconstpointer a, GtkRecentInfo *info_a = (GtkRecentInfo *) a; GtkRecentInfo *info_b = (GtkRecentInfo *) b; - return (gtk_recent_info_get_modified (info_a) < gtk_recent_info_get_modified (info_b)); + return (gtk_recent_info_get_modified (info_b) - gtk_recent_info_get_modified (info_a)); } static gint diff --git a/gtk/gtkrecentchooserutils.c b/gtk/gtkrecentchooserutils.c index 06665ede5..29a772aaa 100644 --- a/gtk/gtkrecentchooserutils.c +++ b/gtk/gtkrecentchooserutils.c @@ -302,7 +302,7 @@ sort_recent_items_mru (GtkRecentInfo *a, { g_assert (a != NULL && b != NULL); - return (gtk_recent_info_get_modified (a) < gtk_recent_info_get_modified (b)); + return gtk_recent_info_get_modified (b) - gtk_recent_info_get_modified (a); } static gint @@ -312,7 +312,7 @@ sort_recent_items_lru (GtkRecentInfo *a, { g_assert (a != NULL && b != NULL); - return (gtk_recent_info_get_modified (a) > gtk_recent_info_get_modified (b)); + return -1 * (gtk_recent_info_get_modified (b) - gtk_recent_info_get_modified (a)); } typedef struct -- 2.43.2