author | zautrix <zautrix> | 2005-06-26 08:17:08 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-26 08:17:08 (UTC) |
commit | f27e8c6cc8abbd27f10167334d608c7e0af7f711 (patch) (unidiff) | |
tree | b516d5512178f98d105a5d77f96aff29dfe09c02 /libkcal | |
parent | 6d8fdbda8cb12b768932a80ccd25d275bc4b30f9 (diff) | |
download | kdepimpi-f27e8c6cc8abbd27f10167334d608c7e0af7f711.zip kdepimpi-f27e8c6cc8abbd27f10167334d608c7e0af7f711.tar.gz kdepimpi-f27e8c6cc8abbd27f10167334d608c7e0af7f711.tar.bz2 |
rec fix
-rw-r--r-- | libkcal/sharpformat.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp index c2ee2c9..9b757f7 100644 --- a/libkcal/sharpformat.cpp +++ b/libkcal/sharpformat.cpp | |||
@@ -778,97 +778,97 @@ QString SharpFormat::getEventString( Event* event ) | |||
778 | break; | 778 | break; |
779 | case Recurrence::rMonthlyPos:// 2 | 779 | case Recurrence::rMonthlyPos:// 2 |
780 | list.append( "2" ); | 780 | list.append( "2" ); |
781 | list.append( QString::number( rec->frequency()) );//12 | 781 | list.append( QString::number( rec->frequency()) );//12 |
782 | 782 | ||
783 | writeEndDate = true; | 783 | writeEndDate = true; |
784 | { | 784 | { |
785 | int count = 1; | 785 | int count = 1; |
786 | QPtrList<Recurrence::rMonthPos> rmp; | 786 | QPtrList<Recurrence::rMonthPos> rmp; |
787 | rmp = rec->monthPositions(); | 787 | rmp = rec->monthPositions(); |
788 | if ( rmp.first()->negative ) | 788 | if ( rmp.first()->negative ) |
789 | count = 5 - rmp.first()->rPos - 1; | 789 | count = 5 - rmp.first()->rPos - 1; |
790 | else | 790 | else |
791 | count = rmp.first()->rPos - 1; | 791 | count = rmp.first()->rPos - 1; |
792 | list.append( QString::number( count ) ); | 792 | list.append( QString::number( count ) ); |
793 | 793 | ||
794 | } | 794 | } |
795 | 795 | ||
796 | list.append( "0" ); | 796 | list.append( "0" ); |
797 | break; | 797 | break; |
798 | case Recurrence::rMonthlyDay:// 3 | 798 | case Recurrence::rMonthlyDay:// 3 |
799 | list.append( "3" ); | 799 | list.append( "3" ); |
800 | list.append( QString::number( rec->frequency()) );//12 | 800 | list.append( QString::number( rec->frequency()) );//12 |
801 | list.append( "0" ); | 801 | list.append( "0" ); |
802 | list.append( "0" ); | 802 | list.append( "0" ); |
803 | writeEndDate = true; | 803 | writeEndDate = true; |
804 | break; | 804 | break; |
805 | case Recurrence::rYearlyMonth://4 | 805 | case Recurrence::rYearlyMonth://4 |
806 | list.append( "4" ); | 806 | list.append( "4" ); |
807 | list.append( QString::number( rec->frequency()) );//12 | 807 | list.append( QString::number( rec->frequency()) );//12 |
808 | list.append( "0" ); | 808 | list.append( "0" ); |
809 | list.append( "0" ); | 809 | list.append( "0" ); |
810 | writeEndDate = true; | 810 | writeEndDate = true; |
811 | break; | 811 | break; |
812 | 812 | ||
813 | default: | 813 | default: |
814 | list.append( "255" ); | 814 | list.append( "255" ); |
815 | list.append( QString() ); | 815 | list.append( QString() ); |
816 | list.append( "0" ); | 816 | list.append( "0" ); |
817 | list.append( QString() ); | 817 | list.append( QString() ); |
818 | list.append( "0" ); | 818 | list.append( "0" ); |
819 | list.append( "20991231T000000" ); | 819 | list.append( "20991231T000000" ); |
820 | break; | 820 | break; |
821 | } | 821 | } |
822 | if ( writeEndDate ) { | 822 | if ( writeEndDate ) { |
823 | 823 | ||
824 | if ( rec->endDate().isValid() ) { // 15 + 16 | 824 | if ( rec->endDate().isValid() ) { // 15 + 16 |
825 | list.append( "1" ); | 825 | list.append( "1" ); |
826 | list.append( dtToString( rec->endDate()) ); | 826 | list.append( dtToString( rec->endDate(), false ) ); |
827 | } else { | 827 | } else { |
828 | list.append( "0" ); | 828 | list.append( "0" ); |
829 | list.append( "20991231T000000" ); | 829 | list.append( "20991231T000000" ); |
830 | } | 830 | } |
831 | 831 | ||
832 | } | 832 | } |
833 | if ( event->doesFloat () ) { | 833 | if ( event->doesFloat () ) { |
834 | list.append( dtToString( event->dtStart(), false ).left( 8 )); | 834 | list.append( dtToString( event->dtStart(), false ).left( 8 )); |
835 | list.append( dtToString( event->dtEnd(), false ).left( 8 )); //6 | 835 | list.append( dtToString( event->dtEnd(), false ).left( 8 )); //6 |
836 | 836 | ||
837 | } | 837 | } |
838 | else { | 838 | else { |
839 | list.append( QString() ); | 839 | list.append( QString() ); |
840 | list.append( QString() ); | 840 | list.append( QString() ); |
841 | 841 | ||
842 | } | 842 | } |
843 | if (event->dtStart().date() == event->dtEnd().date() ) | 843 | if (event->dtStart().date() == event->dtEnd().date() ) |
844 | list.append( "0" ); | 844 | list.append( "0" ); |
845 | else | 845 | else |
846 | list.append( "1" ); | 846 | list.append( "1" ); |
847 | 847 | ||
848 | 848 | ||
849 | for(QStringList::Iterator it=list.begin(); | 849 | for(QStringList::Iterator it=list.begin(); |
850 | it!=list.end(); ++it){ | 850 | it!=list.end(); ++it){ |
851 | QString& s = (*it); | 851 | QString& s = (*it); |
852 | s.replace(QRegExp("\""), "\"\""); | 852 | s.replace(QRegExp("\""), "\"\""); |
853 | if(s.contains(QRegExp("[,\"\r\n]")) || s.stripWhiteSpace() != s){ | 853 | if(s.contains(QRegExp("[,\"\r\n]")) || s.stripWhiteSpace() != s){ |
854 | s.prepend('\"'); | 854 | s.prepend('\"'); |
855 | s.append('\"'); | 855 | s.append('\"'); |
856 | } else if(s.isEmpty() && !s.isNull()){ | 856 | } else if(s.isEmpty() && !s.isNull()){ |
857 | s = "\"\""; | 857 | s = "\"\""; |
858 | } | 858 | } |
859 | } | 859 | } |
860 | return list.join(","); | 860 | return list.join(","); |
861 | 861 | ||
862 | 862 | ||
863 | } | 863 | } |
864 | QString SharpFormat::getTodoString( Todo* todo ) | 864 | QString SharpFormat::getTodoString( Todo* todo ) |
865 | { | 865 | { |
866 | QStringList list; | 866 | QStringList list; |
867 | list.append( todo->getID("Sharp_DTM") ); | 867 | list.append( todo->getID("Sharp_DTM") ); |
868 | list.append( todo->categories().join(",") ); | 868 | list.append( todo->categories().join(",") ); |
869 | 869 | ||
870 | if ( todo->hasStartDate() ) { | 870 | if ( todo->hasStartDate() ) { |
871 | list.append( dtToString( todo->dtStart()) ); | 871 | list.append( dtToString( todo->dtStart()) ); |
872 | } else | 872 | } else |
873 | list.append( QString() ); | 873 | list.append( QString() ); |
874 | 874 | ||