summaryrefslogtreecommitdiff
path: root/desktop/global_history.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-06-04 12:12:20 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2013-06-04 12:12:20 +0100
commitcdf9c9ba72c7588a1e3f503fea9f288c8394af9e (patch)
tree062ef1ee2229cf1a69b42b7ffab6c0951dfd69f1 /desktop/global_history.c
parenta86dd681657ee4d5bd108baaf6825abb47957559 (diff)
downloadnetsurf-cdf9c9ba72c7588a1e3f503fea9f288c8394af9e.tar.gz
netsurf-cdf9c9ba72c7588a1e3f503fea9f288c8394af9e.tar.bz2
Sort so newest at top.
Diffstat (limited to 'desktop/global_history.c')
-rw-r--r--desktop/global_history.c14
1 files changed, 11 insertions, 3 deletions
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;
}
}