# HG changeset patch # User Olaf Wintermann # Date 1707384569 -3600 # Node ID cdcb20412dd4ab22d15e5724812682e8068a14f7 # Parent d7942163a2a3cb453d4a3b2495d9d36271d11507 implement upload via file dialog diff -r d7942163a2a3 -r cdcb20412dd4 application/application.c --- 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) {