summaryrefslogtreecommitdiff
path: root/desktop/browser_history.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2017-09-10 10:30:27 +0100
committerVincent Sanders <vince@kyllikki.org>2017-09-10 10:31:06 +0100
commitec94d5f812723c586b26d4c1700b641e5cb2f7a0 (patch)
tree8d4d441246195897ce5a5e0d513c4a47828b317e /desktop/browser_history.c
parent02a8b5bca0cfe8307624dc7c2bf736069c0a2e0b (diff)
downloadnetsurf-ec94d5f812723c586b26d4c1700b641e5cb2f7a0.tar.gz
netsurf-ec94d5f812723c586b26d4c1700b641e5cb2f7a0.tar.bz2
move history bitmap thumbnail into the page information structure
Diffstat (limited to 'desktop/browser_history.c')
-rw-r--r--desktop/browser_history.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/desktop/browser_history.c b/desktop/browser_history.c
index c7d010419..ba122f30d 100644
--- a/desktop/browser_history.c
+++ b/desktop/browser_history.c
@@ -326,19 +326,21 @@ nserror browser_window_history_add(struct browser_window *bw,
}
entry->page.url = nsurl_ref(nsurl);
- entry->page.frag_id = frag_id ? lwc_string_ref(frag_id) : 0;
-
+ entry->page.frag_id = frag_id ? lwc_string_ref(frag_id) : NULL;
entry->page.title = title;
+ entry->page.bitmap = NULL;
+
entry->back = history->current;
entry->next = 0;
entry->forward = entry->forward_pref = entry->forward_last = 0;
entry->children = 0;
- entry->bitmap = 0;
+
if (history->current) {
- if (history->current->forward_last)
+ if (history->current->forward_last) {
history->current->forward_last->next = entry;
- else
+ } else {
history->current->forward = entry;
+ }
history->current->forward_pref = entry;
history->current->forward_last = entry;
history->current->children++;
@@ -373,7 +375,7 @@ nserror browser_window_history_add(struct browser_window *bw,
}
}
}
- entry->bitmap = bitmap;
+ entry->page.bitmap = bitmap;
browser_window_history__layout(history);
@@ -392,7 +394,9 @@ nserror browser_window_history_update(struct browser_window *bw,
history = bw->history;
- if (!history || !history->current || !history->current->bitmap) {
+ if (!history ||
+ !history->current ||
+ !history->current->page.bitmap) {
return NSERROR_INVALID;
}
@@ -407,7 +411,7 @@ nserror browser_window_history_update(struct browser_window *bw,
free(history->current->page.title);
history->current->page.title = title;
- guit->bitmap->render(history->current->bitmap, content);
+ guit->bitmap->render(history->current->page.bitmap, content);
return NSERROR_OK;
}