From e00fb7bd2d8eed482d6d9eac1d7fec09e079a25b Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 29 Mar 2010 20:03:44 +0000 Subject: second pass at startup refactor removing the gui_init callback svn path=/trunk/netsurf/; revision=10205 --- framebuffer/gui.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'framebuffer') diff --git a/framebuffer/gui.c b/framebuffer/gui.c index fcce00a71..c537c705b 100644 --- a/framebuffer/gui.c +++ b/framebuffer/gui.c @@ -391,7 +391,7 @@ static bool process_cmdline(int argc, char** argv) } -void gui_init(int argc, char** argv) +static void gui_init(int argc, char** argv) { char buf[PATH_MAX]; nsfb_t *nsfb; @@ -401,19 +401,8 @@ void gui_init(int argc, char** argv) if (hubbub_initialise(buf, myrealloc, NULL) != HUBBUB_OK) die("Unable to initialise HTML parsing library.\n"); - /* load browser messages */ - fb_find_resource(buf, "messages", "./framebuffer/res/messages"); - LOG(("Using '%s' as Messages file", buf)); - messages_load(buf); - option_core_select_menu = true; - /* load browser options */ - fb_find_resource(buf, "Choices-fb", "~/.netsurf/Choices-fb"); - LOG(("Using '%s' as Preferences file", buf)); - options_file_location = strdup(buf); - options_read(buf); - /* set up stylesheet urls */ fb_find_resource(buf, "default.css", "./framebuffer/res/default.css"); default_stylesheet_url = path_to_url(buf); @@ -454,9 +443,18 @@ static void gui_init2(int argc, char** argv) */ int main(int argc, char** argv) { + char options[PATH_MAX]; + char messages[PATH_MAX]; + setbuf(stderr, NULL); - netsurf_init(argc, argv); + fb_find_resource(messages, "messages", "./framebuffer/res/messages"); + fb_find_resource(options, "Choices-fb", "~/.netsurf/Choices-fb"); + options_file_location = strdup(options); + + netsurf_init(&argc, &argv, options, messages); + + gui_init(argc, argv); gui_init2(argc, argv); -- cgit v1.2.3