summaryrefslogtreecommitdiff
path: root/desktop/history_core.c
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@netsurf-browser.org>2010-03-28 12:56:39 +0000
committerDaniel Silverstone <dsilvers@netsurf-browser.org>2010-03-28 12:56:39 +0000
commit270ef59a98d34fef418fb6cd27e46f3edc912948 (patch)
tree9d363b42d441640e1d2dbff3ba548a2cdf8d67a9 /desktop/history_core.c
parent21da4f5bdf74c6654730c32dfcc1c6b3d24da4b4 (diff)
downloadnetsurf-270ef59a98d34fef418fb6cd27e46f3edc912948.tar.gz
netsurf-270ef59a98d34fef418fb6cd27e46f3edc912948.tar.bz2
Merge jmb/new-cache; r=dsilvers,rs=vince
svn path=/trunk/netsurf/; revision=10180
Diffstat (limited to 'desktop/history_core.c')
-rw-r--r--desktop/history_core.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/desktop/history_core.c b/desktop/history_core.c
index 197a42327..fc807e928 100644
--- a/desktop/history_core.c
+++ b/desktop/history_core.c
@@ -27,6 +27,7 @@
#include <string.h>
#include <time.h>
#include "content/content.h"
+#include "content/hlcache.h"
#include "content/urldb.h"
#include "css/css.h"
#include "desktop/gui.h"
@@ -220,7 +221,7 @@ struct history_entry *history_clone_entry(struct history *history,
* The page is added after the current entry and becomes current.
*/
-void history_add(struct history *history, struct content *content,
+void history_add(struct history *history, hlcache_handle *content,
char *frag_id)
{
url_func_result res;
@@ -237,14 +238,14 @@ void history_add(struct history *history, struct content *content,
if (entry == NULL)
return;
- res = url_normalize(content->url, &url);
+ res = url_normalize(content_get_url(content), &url);
if (res != URL_FUNC_OK) {
warn_user("NoMemory", 0);
free(entry);
return;
}
- title = strdup(content->title ? content->title : url);
+ title = strdup(content_get_title(content));
if (title == NULL) {
warn_user("NoMemory", 0);
free(url);
@@ -303,11 +304,9 @@ void history_add(struct history *history, struct content *content,
* \param content content for current entry
*/
-void history_update(struct history *history, struct content *content)
+void history_update(struct history *history, hlcache_handle *content)
{
char *title;
- char *url;
- url_func_result res;
if (!history || !history->current || !history->current->bitmap)
return;
@@ -315,19 +314,10 @@ void history_update(struct history *history, struct content *content)
assert(history->current->page.url);
assert(history->current->page.title);
- if (content->title) {
- title = strdup(content->title);
- if (!title) {
- warn_user("NoMemory", 0);
- return;
- }
- } else {
- res = url_normalize(content->url, &url);
- if (res != URL_FUNC_OK) {
- warn_user("NoMemory", 0);
- return;
- }
- title = url;
+ title = strdup(content_get_title(content));
+ if (!title) {
+ warn_user("NoMemory", 0);
+ return;
}
assert(title);