summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-01-22 23:19:57 +0000
committerVincent Sanders <vince@kyllikki.org>2014-01-23 00:00:18 +0000
commit047569339406f2be1637ae4cee5dd0c9a9c2328f (patch)
tree3d3909b4bc3d27cd7a9e146d32539ce752b33310 /gtk
parent4684e9665d2ddff50f4a8e9a16d73224d2617180 (diff)
downloadnetsurf-047569339406f2be1637ae4cee5dd0c9a9c2328f.tar.gz
netsurf-047569339406f2be1637ae4cee5dd0c9a9c2328f.tar.bz2
create table for fetcher operations and move all operations into it
Diffstat (limited to 'gtk')
-rw-r--r--gtk/filetype.c5
-rw-r--r--gtk/filetype.h1
-rw-r--r--gtk/gui.c14
3 files changed, 12 insertions, 8 deletions
diff --git a/gtk/filetype.c b/gtk/filetype.c
index 2ae59d867..a949b14d5 100644
--- a/gtk/filetype.c
+++ b/gtk/filetype.c
@@ -207,11 +207,6 @@ const char *fetch_filetype(const char *unix_path)
return type != NULL ? type : "text/plain";
}
-char *fetch_mimetype(const char *unix_path)
-{
- return strdup(fetch_filetype(unix_path));
-}
-
#ifdef TEST_RIG
int main(int argc, char *argv[])
diff --git a/gtk/filetype.h b/gtk/filetype.h
index 8bf98db7c..68bb9c0ff 100644
--- a/gtk/filetype.h
+++ b/gtk/filetype.h
@@ -19,3 +19,4 @@
void gtk_fetch_filetype_init(const char *mimefile);
void gtk_fetch_filetype_fin(void);
+const char *fetch_filetype(const char *unix_path);
diff --git a/gtk/gui.c b/gtk/gui.c
index 39dc885da..d6d35029d 100644
--- a/gtk/gui.c
+++ b/gtk/gui.c
@@ -1133,16 +1133,23 @@ static struct gui_clipboard_table nsgtk_clipboard_table = {
.set = gui_set_clipboard,
};
+static struct gui_fetch_table nsgtk_fetch_table = {
+ .filename_from_path = filename_from_path,
+ .path_add_part = path_add_part,
+ .filetype = fetch_filetype,
+
+ .get_resource_url = gui_get_resource_url,
+
+};
+
static struct gui_browser_table nsgtk_browser_table = {
.poll = gui_poll,
+
.quit = gui_quit,
.set_search_ico = gui_set_search_ico,
- .get_resource_url = gui_get_resource_url,
.launch_url = gui_launch_url,
.create_form_select_menu = gui_create_form_select_menu,
.cert_verify = gui_cert_verify,
- .filename_from_path = filename_from_path,
- .path_add_part = path_add_part,
.login = gui_401login_open,
};
@@ -1159,6 +1166,7 @@ int main(int argc, char** argv)
.window = nsgtk_window_table,
.clipboard = &nsgtk_clipboard_table,
.download = nsgtk_download_table,
+ .fetch = &nsgtk_fetch_table,
};
/* check home directory is available */