Thu, 08 Feb 2024 10:29:29 +0100
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) {