application/davcontroller.c

changeset 86
8e7c57c23133
parent 85
44ebbb4c8a13
equal deleted inserted replaced
85:44ebbb4c8a13 86:8e7c57c23133
933 } 933 }
934 ui_set(download->label_top_left, label1.ptr); 934 ui_set(download->label_top_left, label1.ptr);
935 935
936 free(sz_total); 936 free(sz_total);
937 free(label1.ptr); 937 free(label1.ptr);
938 938
939 939
940 return 1; 940 return 1;
941 } 941 }
942 942
943 // dav download file 943 // dav download file
994 free(file->path); 994 free(file->path);
995 free(file->to); 995 free(file->to);
996 free(file); 996 free(file);
997 997
998 return 0; 998 return 0;
999 }
1000
1001 static int qthr_download_finished(void *data) {
1002 return 0;
1003 }
1004
1005 static void uithr_download_finished(UiEvent *event, void *data) {
1006 DavFileDownload *download = data;
1007 printf("download finished\n");
1008 ui_object_unref(download->dialog);
999 } 1009 }
1000 1010
1001 1011
1002 typedef struct DlStackElm { 1012 typedef struct DlStackElm {
1003 DavResource *resource; 1013 DavResource *resource;
1081 ui_call_mainthread(uithr_download_update_progress, download); 1091 ui_call_mainthread(uithr_download_update_progress, download);
1082 1092
1083 ui_threadpool_job(download->queue, download->ui, qthr_download_resource, file, NULL, NULL); 1093 ui_threadpool_job(download->queue, download->ui, qthr_download_resource, file, NULL, NULL);
1084 } 1094 }
1085 } 1095 }
1096
1097 ui_threadpool_job(download->queue, download->ui, qthr_download_finished, download, uithr_download_finished, download);
1086 1098
1087 cxListDestroy(stack); 1099 cxListDestroy(stack);
1088 1100
1089 return 0; 1101 return 0;
1090 } 1102 }
1143 ui_set(download->label_bottom_left, ""); 1155 ui_set(download->label_bottom_left, "");
1144 ui_set(download->label_bottom_right, ""); 1156 ui_set(download->label_bottom_right, "");
1145 ui_set(download->progress, 0); 1157 ui_set(download->progress, 0);
1146 1158
1147 ui_show(dialog); 1159 ui_show(dialog);
1160
1161 ui_object_ref(dialog);
1148 1162
1149 // start upload and stat threads 1163 // start upload and stat threads
1150 ui_job(ui, jobthr_download_scan, download, uithr_download_scan_finished, download); 1164 ui_job(ui, jobthr_download_scan, download, uithr_download_scan_finished, download);
1151 } 1165 }
1152 1166

mercurial