fix errors introduced in refactor

This commit is contained in:
Vincent Sanders 2013-02-18 12:24:49 +00:00
parent 529ca251fc
commit 0eb0798873
8 changed files with 53 additions and 38 deletions

View File

@ -4782,11 +4782,12 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg
warn_user("NoMemory", 0);
} else {
if(gwin->key_state & BROWSER_MOUSE_MOD_2) {
browser_window_create(url,
NULL,
gwin->bw,
false,
true);
browser_window_create(BROWSER_WINDOW_VERIFIABLE |
BROWSER_WINDOW_TAB,
url,
NULL,
gwin->bw
NULL);
} else {
browser_window_navigate(gwin->bw,
url,

View File

@ -1037,7 +1037,7 @@ static void ami_menu_item_hotlist_entries(struct Hook *hook, APTR window, struct
if(urltxt == NULL) return;
error = nsurl_create(addr, &url);
error = nsurl_create(urltxt, &url);
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
} else {

View File

@ -257,7 +257,8 @@ void context_popup(struct gui_window * gw, short x, short y)
BROWSER_WINDOW_HISTORY,
url,
hlcache_handle_get_url(gw->browser->bw->current_content),
gw->browser->bw
gw->browser->bw,
NULL
);
nsurl_unref(url);
}

View File

@ -67,22 +67,22 @@
- (IBAction) navigate: (id) sender;
{
nsurl *unsrl;
nsurl *urlns;
nserror error;
error = nsurl_create([url UTF8String], &url);
error = nsurl_create([url UTF8String], &urlns);
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
} else {
browser_window_navigate(browser,
nsurl,
urlns,
NULL,
BROWSER_WINDOW_HISTORY |
BROWSER_WINDOW_VERIFIABLE,
NULL,
NULL,
NULL);
nsurl_unref(url);
nsurl_unref(urlns);
}
}
@ -131,24 +131,24 @@
- (IBAction) goHome: (id) sender;
{
nsurl *url;
nserror error;
error = nsurl_create(nsoption_charp(homepage_url), &url);
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
} else {
browser_window_navigate(browser,
url,
NULL,
BROWSER_WINDOW_HISTORY |
BROWSER_WINDOW_VERIFIABLE,
NULL,
NULL,
NULL);
nsurl_unref(url);
}
nsurl *urlns;
nserror error;
error = nsurl_create(nsoption_charp(homepage_url), &urlns);
if (error == NSERROR_OK) {
error = browser_window_navigate(browser,
urlns,
NULL,
BROWSER_WINDOW_HISTORY |
BROWSER_WINDOW_VERIFIABLE,
NULL,
NULL,
NULL);
nsurl_unref(urlns);
}
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
}
}
- (IBAction) reloadPage: (id) sender;

View File

@ -25,6 +25,7 @@
#include "desktop/gui.h"
#include "utils/ring.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "monkey/browser.h"
#include "monkey/plot.h"

View File

@ -781,7 +781,7 @@ static void gui_init2(int argc, char** argv)
nsurl *urlns;
nserror errorns;
errorns = nsurl_create(yrl, &urlns);
errorns = nsurl_create(url, &urlns);
if (errorns == NSERROR_OK) {
errorns = browser_window_create(BROWSER_WINDOW_VERIFIABLE |
BROWSER_WINDOW_HISTORY,

View File

@ -130,7 +130,6 @@ bool ro_gui_iconbar_click(wimp_pointer *pointer)
}
/* create an initial browser window */
error = nsurl_create(addr, &url);
if (error == NSERROR_OK) {
error = browser_window_create(BROWSER_WINDOW_VERIFIABLE |
BROWSER_WINDOW_HISTORY,
@ -193,15 +192,29 @@ void ro_gui_iconbar_menu_warning(wimp_w w, wimp_i i, wimp_menu *menu,
bool ro_gui_iconbar_menu_select(wimp_w w, wimp_i i, wimp_menu *menu,
wimp_selection *selection, menu_action action)
{
nsurl *url;
nserror error;
if (w != wimp_ICON_BAR || i != wimp_ICON_WINDOW)
return false;
switch (action) {
case HELP_OPEN_CONTENTS:
browser_window_create(
"http://www.netsurf-browser.org/documentation/",
NULL, 0, true, false);
error = nsurl_create("http://www.netsurf-browser.org/documentation/", &url);
if (error == NSERROR_OK) {
error = browser_window_create(BROWSER_WINDOW_GO_FLAG_VERIFIABLE |
BROWSER_WINDOW_GO_FLAG_HISTORY,
url,
NULL,
NULL,
NULL);
nsurl_unref(url);
}
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
}
return true;
case BROWSER_NAVIGATE_URL:
ro_gui_dialog_prepare_open_url();
ro_gui_dialog_open_persistent(NULL, dialog_openurl, true);

View File

@ -41,22 +41,21 @@ void ro_uri_message_received(wimp_message *msg)
uri_h uri_handle;
char* uri_requested;
int uri_length;
nsurl *nsurl;
nsurl *url;
nserror error;
uri_handle = uri_message->handle;
if (nsurl_create(uri_message->uri, &nsurl) != NSERROR_OK) {
if (nsurl_create(uri_message->uri, &url) != NSERROR_OK) {
return;
}
if (!fetch_can_fetch(nsurl)) {
nsurl_unref(nsurl);
if (!fetch_can_fetch(url)) {
nsurl_unref(url);
return;
}
nsurl_unref(nsurl);
nsurl_unref(url);
uri_message->your_ref = uri_message->my_ref;
uri_message->action = message_URI_PROCESS_ACK;