Changeset 2335
- Timestamp:
- 07/14/07 17:03:14 (1 year ago)
- Files:
-
- format-plugins/vformat/src/vformat.c (modified) (1 diff)
- format-plugins/vformat/src/xmlformat-vevent.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
format-plugins/vformat/src/vformat.c
r2330 r2335 890 890 break; 891 891 case VFORMAT_TODO_10: 892 str = g_string_append (str, "BEGIN:VCALENDAR\r\nVERSION:1.0\r\nPRODID:-//OpenSync//NONSGML OpenSync vformat 0.3//EN\r\nBEGIN:VTODO\r\n"); 893 break; 892 case VFORMAT_TODO_20: 894 893 case VFORMAT_EVENT_10: 895 str = g_string_append (str, "BEGIN:VCALENDAR\r\nVERSION:1.0\r\nPRODID:-//OpenSync//NONSGML OpenSync vformat 0.3//EN\r\nBEGIN:VEVENT\r\n");896 break;897 case VFORMAT_TODO_20:898 str = g_string_append (str, "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//OpenSync//NONSGML OpenSync vformat 0.3//EN\r\nBEGIN:VTODO\r\n");899 break;900 894 case VFORMAT_EVENT_20: 901 str = g_string_append (str, "BEGIN:VCALENDAR\r\n VERSION:2.0\r\nPRODID:-//OpenSync//NONSGML OpenSync vformat 0.3//EN\r\nBEGIN:VEVENT\r\n");895 str = g_string_append (str, "BEGIN:VCALENDAR\r\n"); 902 896 break; 903 897 case VFORMAT_NOTE: format-plugins/vformat/src/xmlformat-vevent.c
r2334 r2335 748 748 g_free(str); 749 749 750 // create a new vcalendar 751 VFormat *vcalendar = vformat_new(); 752 753 osync_trace(TRACE_INTERNAL, "parsing xml attributes"); 750 // set default encoding 754 751 const char *std_encoding = NULL; 755 752 if (target == VFORMAT_EVENT_10 || target == VFORMAT_TODO_10) … … 758 755 std_encoding = "B"; 759 756 760 // parsing xml attributes 761 GList *alarmfields = NULL; 762 GList *timezonefields = NULL; 757 // create a new vcalendar 758 VFormat *vcalendar = vformat_new(); 759 760 // start parsing/generating attributes 761 osync_trace(TRACE_INTERNAL, "parsing xml attributes"); 762 763 VFormatAttribute *attr = NULL; 764 765 // prepare vcalendar container 766 if (target == VFORMAT_EVENT_10 || target == VFORMAT_TODO_10) { 767 768 // TODO: Handle DAYLIGHT attribute 769 // TODO: Handle GEO attribute 770 771 attr = vformat_attribute_new(NULL, "PRODID"); 772 vformat_attribute_add_value(attr, "-//OpenSync//NONSGML OpenSync vformat 0.3//EN"); 773 vformat_add_attribute(vcalendar, attr); 774 775 // TODO: Handle TZ attribute 776 777 attr = vformat_attribute_new(NULL, "VERSION"); 778 vformat_attribute_add_value(attr, "1.0"); 779 vformat_add_attribute(vcalendar, attr); 780 781 } else if (target == VFORMAT_EVENT_20 || target == VFORMAT_TODO_20) { 782 783 attr = vformat_attribute_new(NULL, "PRODID"); 784 vformat_attribute_add_value(attr, "-//OpenSync//NONSGML OpenSync vformat 0.3//EN"); 785 vformat_add_attribute(vcalendar, attr); 786 787 attr = vformat_attribute_new(NULL, "VERSION"); 788 vformat_attribute_add_value(attr, "2.0"); 789 vformat_add_attribute(vcalendar, attr); 790 791 // TODO: Handle CALSCALE attribute 792 // TODO: Handle METHOD attribute 793 794 // TODO: Handle VTIMEZONE component 795 796 } 797 798 // set begin attribute 799 attr = vformat_attribute_new(NULL, "BEGIN"); 800 if (target == VFORMAT_EVENT_10 || target == VFORMAT_EVENT_20) { 801 vformat_attribute_add_value(attr, "VEVENT"); 802 } else if (target == VFORMAT_TODO_10 || target == VFORMAT_TODO_20) { 803 vformat_attribute_add_value(attr, "VTODO"); 804 } 805 vformat_add_attribute(vcalendar, attr); 806 807 // TODO: Handle VALARM component 763 808 764 809 OSyncXMLField *xmlfield = osync_xmlformat_get_first_field(xmlformat); 765 810 for(; xmlfield != NULL; xmlfield = osync_xmlfield_get_next(xmlfield)) { 766 811 767 // Skip Alarm* and Timezone* xmlfields , we handle them later812 // Skip Alarm* and Timezone* xmlfields 768 813 if (strstr(osync_xmlfield_get_name(xmlfield), "Alarm")) { 769 814 osync_trace(TRACE_INTERNAL, "Skipping %s", osync_xmlfield_get_name(xmlfield)); 770 alarmfields = g_list_append(alarmfields, xmlfield);771 815 continue; 772 816 } else if (strstr(osync_xmlfield_get_name(xmlfield), "Timezone")) { 773 817 osync_trace(TRACE_INTERNAL, "Skipping %s", osync_xmlfield_get_name(xmlfield)); 774 timezonefields = g_list_append(timezonefields, xmlfield);775 818 continue; 776 819 } … … 779 822 } 780 823 781 // TODO: Handle timezone and alarm xmlfields824 osync_trace(TRACE_INTERNAL, "parsing xml attributes finished"); 782 825 783 826 // free hash tables
