summaryrefslogtreecommitdiff
path: root/monkey
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-10-05 08:32:52 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2011-10-05 08:32:52 +0000
commitd5bb9d98e7f98f0c3d706197231d58c4369d6b56 (patch)
tree8bf4f0941f6b48ced521004d0cb929ed69521dcf /monkey
parenta25f87a739943312b0a0ffa3943b584fd8265102 (diff)
downloadnetsurf-d5bb9d98e7f98f0c3d706197231d58c4369d6b56.tar.gz
netsurf-d5bb9d98e7f98f0c3d706197231d58c4369d6b56.tar.bz2
Build resource: map at start time
Remove stylesheet url globals -- the core will always use resource:{default,quirks,adblock}.css as appropriate svn path=/trunk/netsurf/; revision=12949
Diffstat (limited to 'monkey')
-rw-r--r--monkey/main.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/monkey/main.c b/monkey/main.c
index f4b75e00e..d1507f6b4 100644
--- a/monkey/main.c
+++ b/monkey/main.c
@@ -34,10 +34,6 @@
#include "utils/filepath.h"
#include "utils/url.h"
-char *default_stylesheet_url = NULL;
-char *quirks_stylesheet_url = NULL;
-char *adblock_stylesheet_url = NULL;
-
static char **respaths; /** resource search path vector */
/* Stolen from gtk/gui.c */
@@ -64,18 +60,24 @@ void gui_quit(void)
urldb_save_cookies(option_cookie_jar);
urldb_save(option_url_file);
sslcert_cleanup();
- free(default_stylesheet_url);
- free(quirks_stylesheet_url);
- free(adblock_stylesheet_url);
free(option_cookie_file);
free(option_cookie_jar);
gtk_fetch_filetype_fin();
}
-char* gui_get_resource_url(const char *filename)
+nsurl *gui_get_resource_url(const char *path)
{
char buf[PATH_MAX];
- return path_to_url(filepath_sfind(respaths, buf, filename));
+ char *raw;
+ nsurl *url = NULL;
+
+ raw = path_to_url(filepath_sfind(respaths, buf, path));
+ if (raw != NULL) {
+ nsurl_create(raw, &url);
+ free(raw);
+ }
+
+ return url;
}
void
@@ -115,10 +117,6 @@ main(int argc, char **argv)
filepath_sfinddef(respaths, buf, "mime.types", "/etc/");
gtk_fetch_filetype_init(buf);
- default_stylesheet_url = strdup("resource:gtkdefault.css");
- quirks_stylesheet_url = strdup("resource:quirks.css");
- adblock_stylesheet_url = strdup("resource:adblock.css");
-
urldb_load(option_url_file);
urldb_load_cookies(option_cookie_file);