[project @ 2005-01-24 22:14:59 by bursa]

Simplify browser_window_go(). Replace browser_window_go_post() with browser_window_go() where possible.

svn path=/import/netsurf/; revision=1466
This commit is contained in:
James Bursa 2005-01-24 22:14:59 +00:00
parent 01b28b7538
commit 2583180b79
8 changed files with 22 additions and 24 deletions

View File

@ -117,7 +117,7 @@ void browser_window_create(const char *url, struct browser_window *clone,
free(bw);
return;
}
browser_window_go(bw, url, referer, false);
browser_window_go(bw, url, referer);
}
@ -127,15 +127,14 @@ void browser_window_create(const char *url, struct browser_window *clone,
* \param bw browser window
* \param url URL to start fetching (copied)
* \param referer the referring uri
* \param download download, rather than render the uri
*
* Any existing fetches in the window are aborted.
*/
void browser_window_go(struct browser_window *bw, const char *url,
char* referer, bool download)
char* referer)
{
browser_window_go_post(bw, url, 0, 0, true, referer, download);
browser_window_go_post(bw, url, 0, 0, true, referer, false);
}
@ -321,7 +320,8 @@ void browser_window_callback(content_msg msg, struct content *c,
/* the spec says nothing about referrers and
* redirects => follow Mozilla and preserve the
* referer across the redirect */
browser_window_go(bw, data.redirect, bw->referer,
browser_window_go_post(bw, data.redirect, 0, 0,
bw->history_add, bw->referer,
bw->download);
break;
@ -521,7 +521,7 @@ void browser_window_reload(struct browser_window *bw, bool all)
}
bw->current_content->fresh = false;
browser_window_go_post(bw, bw->current_content->url, 0, 0,
false, 0, false);
false, 0, false);
}
@ -829,14 +829,15 @@ void browser_window_mouse_click_html(struct browser_window *bw,
pointer = GUI_POINTER_POINT;
if (click == BROWSER_MOUSE_CLICK_1) {
browser_window_go(bw, url, c->url, false);
browser_window_go(bw, url, c->url);
}
else if (click == BROWSER_MOUSE_CLICK_2) {
browser_window_create(url, bw, c->url);
}
else if (click == BROWSER_MOUSE_CLICK_1_MOD ||
click == BROWSER_MOUSE_CLICK_2_MOD) {
browser_window_go(bw, url, c->url, true);
browser_window_go_post(bw, url, 0, 0, false, c->url,
true);
}
} else if (title) {
@ -1968,8 +1969,7 @@ void browser_form_submit(struct browser_window *bw, struct form *form,
res = url_join(url, base, &url1);
if (res != URL_FUNC_OK)
break;
browser_window_go(bw, url1,
bw->current_content->url, false);
browser_window_go(bw, url1, bw->current_content->url);
break;
case method_POST_URLENC:

View File

@ -89,7 +89,7 @@ typedef enum {
void browser_window_create(const char *url, struct browser_window *clone,
char *referer);
void browser_window_go(struct browser_window *bw, const char *url,
char *referer, bool download);
char *referer);
void browser_window_go_post(struct browser_window *bw, const char *url,
char *post_urlenc,
struct form_successful_control *post_multipart,

View File

@ -210,7 +210,7 @@ gboolean gui_window_url_key_press_event(GtkWidget *widget,
referer = g->bw->current_content->url;
browser_window_go(g->bw, gtk_entry_get_text(GTK_ENTRY(g->url_bar)),
referer, false);
referer);
return TRUE;
}

View File

@ -103,7 +103,7 @@ bool ro_gui_401login_keypress(wimp_key *key)
case wimp_KEY_RETURN:
get_unamepwd();
ro_gui_dialog_close(dialog_401li);
browser_window_go(bwin, url, 0, false);
browser_window_go(bwin, url, 0);
return true;
}
@ -122,7 +122,7 @@ void ro_gui_401login_click(wimp_pointer *pointer)
case ICON_401LOGIN_LOGIN:
get_unamepwd();
ro_gui_dialog_close(dialog_401li);
browser_window_go(bwin, url, 0, false);
browser_window_go(bwin, url, 0);
break;
case ICON_401LOGIN_CANCEL:
ro_gui_dialog_close(dialog_401li);

View File

@ -1184,7 +1184,7 @@ void ro_msg_dataload(wimp_message *message)
return;
if (g) {
browser_window_go(g->bw, url, 0, false);
browser_window_go(g->bw, url, 0);
} else {
if ((hotlist_tree) && ((wimp_w)hotlist_tree->handle ==
message->data.data_xfer.w)) {

View File

@ -951,13 +951,12 @@ void ro_gui_menu_selection(wimp_selection *selection)
switch (selection->items[1]) {
case 0: /* Home */
if (option_homepage_url && option_homepage_url[0]) {
browser_window_go_post(current_gui->bw, option_homepage_url,
0, 0, true, 0, false);
browser_window_go(current_gui->bw, option_homepage_url, 0);
} else {
snprintf(url, sizeof url,
"file:/<NetSurf$Dir>/Docs/intro_%s",
option_language);
browser_window_go_post(current_gui->bw, url, 0, 0, true, 0, false);
browser_window_go(current_gui->bw, url, 0);
}
break;
case 1: /* Back */

View File

@ -800,8 +800,7 @@ void plugin_url_access(wimp_message *message)
strcasecmp(window, "_parent") == 0 ||
strcasecmp(window, "_top") == 0 ||
strcasecmp(window, "") == 0) {
browser_window_go(c->data.plugin.bw, url,
0, false);
browser_window_go(c->data.plugin.bw, url, 0);
}
else if (strcasecmp(window, "_blank") == 0) {
browser_window_create(url, NULL, 0);

View File

@ -1128,8 +1128,8 @@ void ro_gui_toolbar_click(struct gui_window *g, wimp_pointer *pointer)
case ICON_TOOLBAR_HOME:
if (option_homepage_url && option_homepage_url[0]) {
if (pointer->buttons == wimp_CLICK_SELECT) {
browser_window_go_post(g->bw, option_homepage_url,
0, 0, true, 0, false);
browser_window_go(g->bw,
option_homepage_url, 0);
} else {
browser_window_create(option_homepage_url, NULL, 0);
}
@ -1138,7 +1138,7 @@ void ro_gui_toolbar_click(struct gui_window *g, wimp_pointer *pointer)
"file:/<NetSurf$Dir>/Docs/intro_%s",
option_language);
if (pointer->buttons == wimp_CLICK_SELECT) {
browser_window_go_post(g->bw, url, 0, 0, true, 0, false);
browser_window_go(g->bw, url, 0);
} else {
browser_window_create(url, NULL, 0);
}
@ -1518,7 +1518,7 @@ bool ro_gui_window_keypress(struct gui_window *g, int key, bool toolbar)
res = url_normalize(toolbar_url, &url);
if (res == URL_FUNC_OK) {
gui_window_set_url(g, url);
browser_window_go(g->bw, url, 0, false);
browser_window_go(g->bw, url, 0);
free(url);
}
return true;