From cdf9c9ba72c7588a1e3f503fea9f288c8394af9e Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 4 Jun 2013 12:12:20 +0100 Subject: Sort so newest at top. --- desktop/global_history.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'desktop/global_history.c') diff --git a/desktop/global_history.c b/desktop/global_history.c index f479e754a..5ebc1ec27 100644 --- a/desktop/global_history.c +++ b/desktop/global_history.c @@ -508,14 +508,22 @@ static nserror global_history_init_entries(void) /* Itterate over all global history data, inserting it into treeview */ for (i = 0; i < N_DAYS; i++) { + struct global_history_entry *l = NULL; struct global_history_entry *e = gh_list[i]; - + + /* Insert in reverse order; find last */ while (e != NULL) { - err = global_history_entry_insert(e, i); + l = e; + e = e->next; + } + + /* Insert the entries into the treeview */ + while (l != NULL) { + err = global_history_entry_insert(l, i); if (err != NSERROR_OK) { return err; } - e = e->next; + l = l->prev; } } -- cgit v1.2.3