summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2003-11-20 00:16:31 +0000
committerJames Bursa <james@netsurf-browser.org>2003-11-20 00:16:31 +0000
commit9e13c0f9a33f3f4ce08f9df937e24e686040d960 (patch)
treebb3d5dfa1c0e1ce2b88e2df824e12e28ff96c078 /desktop
parent9472e0c668e69a6a636a321fb15826ab0a797d62 (diff)
downloadnetsurf-9e13c0f9a33f3f4ce08f9df937e24e686040d960.tar.gz
netsurf-9e13c0f9a33f3f4ce08f9df937e24e686040d960.tar.bz2
[project @ 2003-11-20 00:16:31 by bursa]
Clean up and simplify themes, remove old history code. svn path=/import/netsurf/; revision=420
Diffstat (limited to 'desktop')
-rw-r--r--desktop/browser.c92
-rw-r--r--desktop/browser.h12
2 files changed, 1 insertions, 103 deletions
diff --git a/desktop/browser.c b/desktop/browser.c
index 846d915b3..b05a3da25 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -101,71 +101,12 @@ void browser_window_reformat(struct browser_window* bw, int scroll_to_top)
LOG(("done"));
}
-/* create a new history item */
-struct history* history_create(char* desc, char* url)
-{
- struct history* h = xcalloc(1, sizeof(struct history));
- LOG(("desc = %s, url = %s", desc, url));
- h->description = 0;
- if (desc != 0)
- h->description = xstrdup(desc);
- h->url = xstrdup(url);
- LOG(("return h = %p", h));
- return h;
-}
-
void browser_window_back(struct browser_window* bw)
{
- if (bw->history != NULL)
- {
- if (bw->history->earlier != NULL)
- {
- bw->history = bw->history->earlier;
- browser_window_open_location_historical(bw, bw->history->url, 0, 0);
- }
- }
}
void browser_window_forward(struct browser_window* bw)
{
- if (bw->history != NULL)
- {
- if (bw->history->later != NULL)
- {
- bw->history = bw->history->later;
- browser_window_open_location_historical(bw, bw->history->url, 0, 0);
- }
- }
-}
-
-/* remember a new page after the current one. anything remembered after the
- current page is forgotten. */
-void history_remember(struct history* current, char* desc, char* url)
-{
- struct history* h;
- LOG(("current = %p, desc = %s, url = %s", current, desc, url));
- assert(current != NULL);
-
- /* forget later history items */
- h = current->later;
- while (h != NULL)
- {
- struct history* hh;
- hh = h;
- h = h->later;
-
- if (hh->description != NULL)
- xfree(hh->description);
- if (hh->url != NULL)
- xfree(hh->url);
-
- xfree(hh);
- }
-
- current->later = history_create(desc, url);
- current->later->earlier = current;
-
- LOG(("end"));
}
@@ -184,7 +125,7 @@ struct browser_window* create_browser_window(int flags, int width, int height)
bw->current_content = NULL;
bw->loading_content = NULL;
- bw->history = NULL;
+ bw->history_entry = 0;
bw->url = NULL;
bw->caret_callback = 0;
@@ -214,29 +155,6 @@ void browser_window_destroy(struct browser_window* bw)
if (bw->loading_content != NULL) {
content_remove_user(bw->loading_content, browser_window_callback, bw, 0);
}
-/*
- if (bw->history != NULL)
- {
- struct history* current = bw->history;
-
- while (current->earlier != NULL)
- current = current->earlier;
-
- while (current != NULL)
- {
- struct history* hh;
- hh = current;
- current = current->later;
-
- if (hh->description != NULL)
- xfree(hh->description);
- if (hh->url != NULL)
- xfree(hh->url);
-
- xfree(hh);
- }
- }
-*/
xfree(bw->url);
gui_window_destroy(bw->window);
@@ -296,14 +214,6 @@ void browser_window_open_location_post(struct browser_window* bw,
url = url_join(url0, bw->url);
browser_window_open_location_historical(bw, url, post_urlenc, post_multipart);
bw->history_add = true;
- /* TODO: move this to somewhere below CONTENT_MSG_READY below */
- if (bw->history == NULL)
- bw->history = history_create(NULL, url);
- else
- {
- history_remember(bw->history, NULL, url);
- bw->history = bw->history->later;
- }
xfree(url);
LOG(("end"));
}
diff --git a/desktop/browser.h b/desktop/browser.h
index e25472631..ae59c2876 100644
--- a/desktop/browser.h
+++ b/desktop/browser.h
@@ -30,17 +30,6 @@ typedef int action_buttons;
#define act_BUTTON_ALTERNATIVE ((action_buttons) 1)
#define act_BUTTON_CONTEXT_MENU ((action_buttons) 2)
-struct history
-{
- struct history* earlier;
- struct history* later;
- char* description;
- char* url;
-};
-
-struct history* history_create(char* desc, char* url);
-void history_remember(struct history* current, char* desc, char* url);
-
struct history_entry;
struct browser_window
@@ -52,7 +41,6 @@ struct browser_window
struct content* current_content;
void *current_content_state;
struct content* loading_content;
- struct history* history;
struct history_entry *history_entry;
bool history_add;
clock_t time0;