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 --- beos/filetype.cpp | 6 ------ beos/filetype.h | 1 + beos/gui.cpp | 17 ++++++++++++----- 3 files changed, 13 insertions(+), 11 deletions(-) (limited to 'beos') diff --git a/beos/filetype.cpp b/beos/filetype.cpp index 7975041ac..d5bd3d77b 100644 --- a/beos/filetype.cpp +++ b/beos/filetype.cpp @@ -135,9 +135,3 @@ const char *fetch_filetype(const char *unix_path) return type; } - -char *fetch_mimetype(const char *unix_path) -{ - return strdup(fetch_filetype(unix_path)); -} - diff --git a/beos/filetype.h b/beos/filetype.h index ab0ef410f..72252dbd0 100644 --- a/beos/filetype.h +++ b/beos/filetype.h @@ -18,3 +18,4 @@ void beos_fetch_filetype_init(void); void beos_fetch_filetype_fin(void); +const char *fetch_filetype(const char *unix_path); diff --git a/beos/gui.cpp b/beos/gui.cpp index feac53a29..ca176c83f 100644 --- a/beos/gui.cpp +++ b/beos/gui.cpp @@ -1067,13 +1067,18 @@ static struct gui_clipboard_table beos_clipboard_table = { gui_set_clipboard, }; +static struct gui_fetch_table beos_fetch_table = { + filename_from_path, + path_add_part, + fetch_filetype, + gui_get_resource_url, + NULL //fetch_mimetype +}; + static struct gui_browser_table beos_browser_table = { gui_poll, - filename_from_path, - path_add_part, gui_quit, NULL, //set_search_ico - gui_get_resource_url, gui_launch_url, NULL, //create_form_select_menu NULL, //cert_verify @@ -1090,7 +1095,8 @@ int main(int argc, char** argv) &beos_browser_table, beos_window_table, beos_download_table, - &beos_clipboard_table + &beos_clipboard_table, + &beos_fetch_table }; if (find_directory(B_USER_SETTINGS_DIRECTORY, &options, true) == B_OK) { @@ -1141,7 +1147,8 @@ int gui_init_replicant(int argc, char** argv) &beos_browser_table, beos_window_table, beos_download_table, - &beos_clipboard_table + &beos_clipboard_table, + &beos_fetch_table }; if (find_directory(B_USER_SETTINGS_DIRECTORY, &options, true) == B_OK) { -- cgit v1.2.3