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 --- amiga/filetype.c | 6 ------ amiga/filetype.h | 3 +++ amiga/gui.c | 12 +++++++++--- 3 files changed, 12 insertions(+), 9 deletions(-) (limited to 'amiga') diff --git a/amiga/filetype.c b/amiga/filetype.c index 39e874ab0..0cb4ac454 100644 --- a/amiga/filetype.c +++ b/amiga/filetype.c @@ -144,12 +144,6 @@ const char *fetch_filetype(const char *unix_path) return mimetype; } - -char *fetch_mimetype(const char *ro_path) -{ - return strdup(fetch_filetype(ro_path)); -} - const char *ami_content_type_to_file_type(content_type type) { switch(type) diff --git a/amiga/filetype.h b/amiga/filetype.h index 851dddf36..e99f5950c 100644 --- a/amiga/filetype.h +++ b/amiga/filetype.h @@ -27,6 +27,8 @@ struct hlcache_handle; struct ami_mime_entry; +const char *fetch_filetype(const char *unix_path); + nserror ami_mime_init(const char *mimefile); void ami_mime_free(void); void ami_mime_entry_free(struct ami_mime_entry *mimeentry); @@ -46,4 +48,5 @@ bool ami_mime_compare(struct hlcache_handle *c, const char *type); /* deprecated */ const char *ami_content_type_to_file_type(content_type type); + #endif diff --git a/amiga/gui.c b/amiga/gui.c index b7ee133fa..6bad1dbee 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -5181,17 +5181,22 @@ static struct gui_window_table amiga_window_table = { .save_link = gui_window_save_link, }; +static struct gui_fetch_table amiga_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 amiga_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, }; @@ -5211,6 +5216,7 @@ int main(int argc, char** argv) .window = &amiga_window_table, .clipboard = amiga_clipboard_table, .download = amiga_download_table, + .fetch = &amiga_fetch_table, }; /* Open popupmenu.library just to check the version. -- cgit v1.2.3