summaryrefslogtreecommitdiff
path: root/amiga/file.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2013-02-22 19:02:58 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2013-02-22 19:02:58 +0000
commit4d9b67499727f1cce58c2bd65a06178f91fc30b4 (patch)
tree0558cd48d512e828a5cafc7ea5fd93249e619e94 /amiga/file.c
parent48bd5e1f102c7a0cf5d71c5df991329c52dccbcc (diff)
downloadnetsurf-4d9b67499727f1cce58c2bd65a06178f91fc30b4.tar.gz
netsurf-4d9b67499727f1cce58c2bd65a06178f91fc30b4.tar.bz2
Remove struct selection from ami_file_save and anywhere that feeds into it
Diffstat (limited to 'amiga/file.c')
-rw-r--r--amiga/file.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/amiga/file.c b/amiga/file.c
index 12ed12a33..68e2637c2 100644
--- a/amiga/file.c
+++ b/amiga/file.c
@@ -148,7 +148,7 @@ static void ami_file_set_type(const char *path, lwc_string *mime_type)
void ami_file_save(int type, char *fname, struct Window *win,
struct hlcache_handle *object, struct hlcache_handle *favicon,
- struct selection *sel)
+ struct browser_window *bw)
{
BPTR lock = 0;
const char *source_data;
@@ -209,7 +209,13 @@ void ami_file_save(int type, char *fname, struct Window *win,
break;
case AMINS_SAVE_SELECTION:
- selection_save_text(sel, fname);
+ if(source_data = browser_window_get_selection(bw)) {
+ if(fh = FOpen(fname, MODE_NEWFILE,0)) {
+ FWrite(fh, source_data, 1, strlen(source_data));
+ FClose(fh);
+ }
+ free(source_data);
+ }
break;
}
if(object) SetComment(fname, nsurl_access(hlcache_handle_get_url(object)));
@@ -219,7 +225,7 @@ void ami_file_save(int type, char *fname, struct Window *win,
}
void ami_file_save_req(int type, struct gui_window_2 *gwin,
- struct hlcache_handle *object, struct selection *sel)
+ struct hlcache_handle *object)
{
char *fname = AllocVec(1024, MEMF_CLEAR | MEMF_PRIVATE);
@@ -232,7 +238,7 @@ void ami_file_save_req(int type, struct gui_window_2 *gwin,
strlcpy(fname, savereq->fr_Drawer, 1024);
AddPart(fname, savereq->fr_File, 1024);
- ami_file_save(type, fname, gwin->win, object, gwin->bw->window->favicon, sel);
+ ami_file_save(type, fname, gwin->win, object, gwin->bw->window->favicon, gwin->bw);
}
if(fname) FreeVec(fname);