From d38f07cc04a1d491ac521af1886e1c0daec5bcc4 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 23 Oct 2014 18:42:07 +0100 Subject: Use url_nice to generate the initial filename for save requesters. Note: We always strip the extension (AmigaOS doesn't need it anyway), which might not necessarily be what you want. --- amiga/file.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/amiga/file.c b/amiga/file.c index dc283a45f..f8f21fd2d 100644 --- a/amiga/file.c +++ b/amiga/file.c @@ -218,13 +218,16 @@ void ami_file_save_req(int type, struct gui_window_2 *gwin, struct hlcache_handle *object) { char *fname = AllocVecTags(1024, NULL); + char *initial_fname = NULL; + + if(object) url_nice(nsurl_access(hlcache_handle_get_url(object)), &initial_fname, true); if(AslRequestTags(savereq, ASLFR_Window, gwin->win, ASLFR_SleepWindow, TRUE, ASLFR_TitleText, messages_get("NetSurf"), ASLFR_Screen, scrn, - ASLFR_InitialFile, object ? FilePart(nsurl_access(hlcache_handle_get_url(object))) : "", + ASLFR_InitialFile, initial_fname ? initial_fname : "", TAG_DONE)) { strlcpy(fname, savereq->fr_Drawer, 1024); @@ -234,6 +237,7 @@ void ami_file_save_req(int type, struct gui_window_2 *gwin, } if(fname) FreeVec(fname); + if(initial_fname) free(initial_fname); } void ami_file_req_init(void) -- cgit v1.2.3