Changeset 2454
- Timestamp:
- 08/16/07 11:43:09 (1 year ago)
- Files:
-
- plugins/opie-sync/src/opie_format.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/opie-sync/src/opie_format.c
r2451 r2454 324 324 xmlFreeDoc(idoc); 325 325 326 // FIXME: remove this later ?326 // FIXME: remove this later by adding in a pre-sorted way? 327 327 osync_xmlformat_sort(out_xmlformat); 328 if(oxf_name) 329 osync_xmlfield_sort(oxf_name); 330 if(oxf_organisation) 331 osync_xmlfield_sort(oxf_organisation); 332 if(oxf_homeaddress) 333 osync_xmlfield_sort(oxf_homeaddress); 334 if(oxf_workaddress) 335 osync_xmlfield_sort(oxf_workaddress); 328 336 329 337 unsigned int size; … … 634 642 } 635 643 out_xmlfield = osync_xmlfield_new(out_xmlformat, "Status", error); 636 osync_xmlfield_set_key_value(out_xmlfield, "Content", iprop->children->content);644 osync_xmlfield_set_key_value(out_xmlfield, "Content", status); 637 645 } 638 646 else if(!strcasecmp(iprop->name, "StartDate")) … … 640 648 out_xmlfield = osync_xmlfield_new(out_xmlformat, "DateStarted", error); 641 649 osync_xmlfield_set_key_value(out_xmlfield, "Content", iprop->children->content); 642 osync_xmlfield_set_ key_value(out_xmlfield, "Value", "DATE"); /* FIXME I doubt this is still valid */650 osync_xmlfield_set_attr(out_xmlfield, "Value", "DATE"); 643 651 } 644 652 else if(!strcasecmp(iprop->name, "Categories")) … … 665 673 // RFC2445 says the default value type is DATE-TIME. But Opie only 666 674 // stores DATE as completed date => alter VALUE to DATE 667 osync_xmlfield_set_ key_value(out_xmlfield, "Value", "DATE"); /* FIXME I doubt this is still valid */675 osync_xmlfield_set_attr(out_xmlfield, "Value", "DATE"); 668 676 xmlFree(completeDate); 669 677 } … … 687 695 duedatestr = g_strdup_printf("%04d%02d%02d", dateyear, datemonth, dateday); 688 696 duedate = g_date_new_dmy(dateday, datemonth, dateyear); 689 out_xmlfield = osync_xmlfield_new(out_xmlformat, "D ateDue", error);697 out_xmlfield = osync_xmlfield_new(out_xmlformat, "Due", error); 690 698 osync_xmlfield_set_key_value(out_xmlfield, "Content", duedatestr); 691 699 // RFC2445 says the default value type is DATE-TIME. But Opie only 692 700 // stores DATE as due date => alter VALUE to DATE 693 osync_xmlfield_set_ key_value(out_xmlfield, "Value", "DATE"); /* FIXME I doubt this is still valid */701 osync_xmlfield_set_attr(out_xmlfield, "Value", "DATE"); 694 702 } 695 703 if(datedaystr) xmlFree(datedaystr); … … 726 734 xmlFreeDoc(idoc); 727 735 728 // FIXME: remove this later ?736 // FIXME: remove this later by adding in a pre-sorted way? 729 737 osync_xmlformat_sort(out_xmlformat); 730 738 … … 827 835 } 828 836 } 829 else if(!strcmp("D ateDue", fieldname)) {837 else if(!strcmp("Due", fieldname)) { 830 838 duestr = osync_xmlfield_get_key_value(in_xmlfield, "Content"); 831 839 if(duestr) { … … 978 986 char *startvdate = g_strdup_printf("%04d%02d%02d", localtm->tm_year + 1900, (localtm->tm_mon + 1), localtm->tm_mday); 979 987 osync_xmlfield_set_key_value(out_xmlfield, "Content", startvdate); 980 osync_xmlfield_set_ key_value(out_xmlfield, "Value", "DATE");988 osync_xmlfield_set_attr(out_xmlfield, "Value", "DATE"); 981 989 g_free(startvdate); 982 990 g_free(localtm); … … 1009 1017 char *endvdate = g_strdup_printf("%04d%02d%02d", localtm->tm_year + 1900, (localtm->tm_mon + 1), localtm->tm_mday); 1010 1018 osync_xmlfield_set_key_value(out_xmlfield, "Content", endvdate); 1011 osync_xmlfield_set_ key_value(out_xmlfield, "Value", "DATE");1019 osync_xmlfield_set_attr(out_xmlfield, "Value", "DATE"); 1012 1020 g_free(endvdate); 1013 1021 g_free(localtm); … … 1074 1082 xmlFreeDoc(idoc); 1075 1083 1076 // FIXME: remove this later ?1084 // FIXME: remove this later by adding in a pre-sorted way? 1077 1085 osync_xmlformat_sort(out_xmlformat); 1078 1086 … … 1239 1247 xmlFreeDoc(idoc); 1240 1248 1241 // FIXME: remove this later ?1249 // FIXME: remove this later by adding in a pre-sorted way? 1242 1250 osync_xmlformat_sort(out_xmlformat); 1243 1251 … … 1419 1427 time_t utime = 0; 1420 1428 if(vtime) { 1421 const char *vtimetype = osync_xmlfield_get_ key_value(xmlfield, "Value");1429 const char *vtimetype = osync_xmlfield_get_attr(xmlfield, "Value"); 1422 1430 if(vtimetype && !strcasecmp(vtimetype, "DATE")) { 1423 1431 /* vtime has date but no time, so we treat it as midnight local time */ … … 1723 1731 for(i=0; alarmargs[i]!=NULL; i++) { 1724 1732 if(i==0) { 1725 char *dateonly = g_strndup(alarmargs[i], 8); 1726 alarmdatestr = g_strdup_printf("%sT%s", dateonly, alarmargs[8]); 1727 g_free(dateonly); 1733 if(strlen(alarmargs[i]) == 14) { 1734 char *dateonly = g_strndup(alarmargs[i], 8); 1735 alarmdatestr = g_strdup_printf("%sT%s", dateonly, alarmargs[i] + 8); 1736 g_free(dateonly); 1737 } 1728 1738 } 1729 1739 else if(i==2)
