From 047569339406f2be1637ae4cee5dd0c9a9c2328f Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 22 Jan 2014 23:19:57 +0000 Subject: create table for fetcher operations and move all operations into it --- gtk/filetype.c | 5 ----- gtk/filetype.h | 1 + gtk/gui.c | 14 +++++++++++--- 3 files changed, 12 insertions(+), 8 deletions(-) (limited to 'gtk') 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 */ -- cgit v1.2.3