application/davcontroller.c

changeset 49
2f71f4ee247a
parent 48
ae61523bce20
child 51
e324291ca9f8
equal deleted inserted replaced
48:ae61523bce20 49:2f71f4ee247a
208 browser->navstack_pos = 0; 208 browser->navstack_pos = 0;
209 209
210 char *nav_url = util_concat_path(base, path); 210 char *nav_url = util_concat_path(base, path);
211 cxListInsert(browser->navigation_stack, 0, nav_url); 211 cxListInsert(browser->navigation_stack, 0, nav_url);
212 212
213 if (browser->navigation_stack->size > DAVBROWSER_MAX_NAVLIST) { 213 if (cxListSize(browser->navigation_stack) > DAVBROWSER_MAX_NAVLIST) {
214 char *nav = cxListAt(browser->navigation_stack, browser->navigation_stack->size - 1); 214 char *nav = cxListAt(browser->navigation_stack, cxListSize(browser->navigation_stack) - 1);
215 free(nav); 215 free(nav);
216 cxListRemove(browser->navigation_stack, browser->navigation_stack->size - 1); 216 cxListRemove(browser->navigation_stack, cxListSize(browser->navigation_stack) - 1);
217 } 217 }
218 } 218 }
219 } 219 }
220 220
221 void davbrowser_navigation_back(UiObject *ui, DavBrowser *browser) { 221 void davbrowser_navigation_back(UiObject *ui, DavBrowser *browser) {
222 if (browser->navstack_pos+1 < browser->navigation_stack->size) { 222 if (browser->navstack_pos+1 < cxListSize(browser->navigation_stack)) {
223 browser->navstack_pos++; 223 browser->navstack_pos++;
224 char *nav_url = cxListAt(browser->navigation_stack, browser->navstack_pos); 224 char *nav_url = cxListAt(browser->navigation_stack, browser->navstack_pos);
225 browser->navstack_enabled = false; 225 browser->navstack_enabled = false;
226 davbrowser_query_url(ui, browser, nav_url); 226 davbrowser_query_url(ui, browser, nav_url);
227 browser->navstack_enabled = true; 227 browser->navstack_enabled = true;
538 f->upload = upload; 538 f->upload = upload;
539 f->error = 0; 539 f->error = 0;
540 cxListInsert(stack, 0, f); 540 cxListInsert(stack, 0, f);
541 } 541 }
542 542
543 while (stack->size > 0) { 543 while (cxListSize(stack) > 0) {
544 DUFile *f = cxListAt(stack, 0); 544 DUFile *f = cxListAt(stack, 0);
545 545
546 char *path = util_concat_path(upload->base_path, f->upload_path); 546 char *path = util_concat_path(upload->base_path, f->upload_path);
547 cxListRemove(stack, 0); 547 cxListRemove(stack, 0);
548 548
826 cxListAdd(stack, &elm); 826 cxListAdd(stack, &elm);
827 827
828 res = res->next; 828 res = res->next;
829 } 829 }
830 830
831 while (stack->size > 0) { 831 while (cxListSize(stack) > 0) {
832 DlStackElm *elm = cxListAt(stack, 0); 832 DlStackElm *elm = cxListAt(stack, 0);
833 DavResource *res = elm->resource; 833 DavResource *res = elm->resource;
834 char *sub_path = elm->sub_path; 834 char *sub_path = elm->sub_path;
835 cxListRemove(stack, 0); 835 cxListRemove(stack, 0);
836 836

mercurial