application/application.c

changeset 23
cdcb20412dd4
parent 18
af411868ab9b
child 26
40d6af793c1a
--- 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