implement upload via file dialog

Thu, 08 Feb 2024 10:29:29 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Thu, 08 Feb 2024 10:29:29 +0100
changeset 23
cdcb20412dd4
parent 22
d7942163a2a3
child 24
12ad3393c151

implement upload via file dialog

application/application.c file | annotate | diff | comparison | revisions
--- a/application/application.c	Thu Feb 08 10:24:20 2024 +0100
+++ b/application/application.c	Thu Feb 08 10:29:29 2024 +0100
@@ -166,8 +166,12 @@
 
 static void file_selected(UiEvent *event, void *data) {
 	UiFileList *files = event->eventdata;
-
-	char *file = files->files[0];
+	if (files && files->nfiles > 0) {
+		// files will be freed by the filedialog handler, therefore we need a copy
+		UiFileList uploadList = ui_filelist_copy(*files); // uploadList will be freed by davbrowser_upload_files
+		davbrowser_upload_files(event->obj, event->document, uploadList);
+	}
+	
 }
 
 void action_upload_file(UiEvent *event, void *data) {

mercurial