author | zautrix <zautrix> | 2005-07-26 21:02:59 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-26 21:02:59 (UTC) |
commit | cdd39d566d5d054edf26bd142d6be05cb35451dd (patch) (unidiff) | |
tree | 33f1b061fc033b690fa8f40e171e1ebe00ee692f /libkcal | |
parent | c7b8804b49e463d42f0bd5aec4b638187190417a (diff) | |
download | kdepimpi-cdd39d566d5d054edf26bd142d6be05cb35451dd.zip kdepimpi-cdd39d566d5d054edf26bd142d6be05cb35451dd.tar.gz kdepimpi-cdd39d566d5d054edf26bd142d6be05cb35451dd.tar.bz2 |
journal fix
-rw-r--r-- | libkcal/icalformatimpl.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp index 3e28714..4794bc9 100644 --- a/libkcal/icalformatimpl.cpp +++ b/libkcal/icalformatimpl.cpp | |||
@@ -978,96 +978,99 @@ FreeBusy *ICalFormatImpl::readFreeBusy(icalcomponent *vfreebusy) | |||
978 | FreeBusy *freebusy = new FreeBusy; | 978 | FreeBusy *freebusy = new FreeBusy; |
979 | 979 | ||
980 | readIncidenceBase(vfreebusy,freebusy); | 980 | readIncidenceBase(vfreebusy,freebusy); |
981 | 981 | ||
982 | icalproperty *p = icalcomponent_get_first_property(vfreebusy,ICAL_ANY_PROPERTY); | 982 | icalproperty *p = icalcomponent_get_first_property(vfreebusy,ICAL_ANY_PROPERTY); |
983 | 983 | ||
984 | icaltimetype icaltime; | 984 | icaltimetype icaltime; |
985 | icalperiodtype icalperiod; | 985 | icalperiodtype icalperiod; |
986 | QDateTime period_start, period_end; | 986 | QDateTime period_start, period_end; |
987 | 987 | ||
988 | while (p) { | 988 | while (p) { |
989 | icalproperty_kind kind = icalproperty_isa(p); | 989 | icalproperty_kind kind = icalproperty_isa(p); |
990 | switch (kind) { | 990 | switch (kind) { |
991 | 991 | ||
992 | case ICAL_DTSTART_PROPERTY: // start date and time | 992 | case ICAL_DTSTART_PROPERTY: // start date and time |
993 | icaltime = icalproperty_get_dtstart(p); | 993 | icaltime = icalproperty_get_dtstart(p); |
994 | freebusy->setDtStart(readICalDateTime(icaltime)); | 994 | freebusy->setDtStart(readICalDateTime(icaltime)); |
995 | break; | 995 | break; |
996 | 996 | ||
997 | case ICAL_DTEND_PROPERTY: // start End Date and Time | 997 | case ICAL_DTEND_PROPERTY: // start End Date and Time |
998 | icaltime = icalproperty_get_dtend(p); | 998 | icaltime = icalproperty_get_dtend(p); |
999 | freebusy->setDtEnd(readICalDateTime(icaltime)); | 999 | freebusy->setDtEnd(readICalDateTime(icaltime)); |
1000 | break; | 1000 | break; |
1001 | 1001 | ||
1002 | case ICAL_FREEBUSY_PROPERTY: //Any FreeBusy Times | 1002 | case ICAL_FREEBUSY_PROPERTY: //Any FreeBusy Times |
1003 | icalperiod = icalproperty_get_freebusy(p); | 1003 | icalperiod = icalproperty_get_freebusy(p); |
1004 | period_start = readICalDateTime(icalperiod.start); | 1004 | period_start = readICalDateTime(icalperiod.start); |
1005 | period_end = readICalDateTime(icalperiod.end); | 1005 | period_end = readICalDateTime(icalperiod.end); |
1006 | freebusy->addPeriod(period_start, period_end); | 1006 | freebusy->addPeriod(period_start, period_end); |
1007 | break; | 1007 | break; |
1008 | 1008 | ||
1009 | default: | 1009 | default: |
1010 | kdDebug(5800) << "ICALFormat::readIncidence(): Unknown property: " << kind | 1010 | kdDebug(5800) << "ICALFormat::readIncidence(): Unknown property: " << kind |
1011 | << endl; | 1011 | << endl; |
1012 | break; | 1012 | break; |
1013 | } | 1013 | } |
1014 | p = icalcomponent_get_next_property(vfreebusy,ICAL_ANY_PROPERTY); | 1014 | p = icalcomponent_get_next_property(vfreebusy,ICAL_ANY_PROPERTY); |
1015 | } | 1015 | } |
1016 | 1016 | ||
1017 | return freebusy; | 1017 | return freebusy; |
1018 | } | 1018 | } |
1019 | 1019 | ||
1020 | Journal *ICalFormatImpl::readJournal(icalcomponent *vjournal) | 1020 | Journal *ICalFormatImpl::readJournal(icalcomponent *vjournal) |
1021 | { | 1021 | { |
1022 | Journal *journal = new Journal; | 1022 | Journal *journal = new Journal; |
1023 | 1023 | ||
1024 | readIncidence(vjournal,journal); | 1024 | readIncidence(vjournal,journal); |
1025 | 1025 | ||
1026 | if ( !journal->dtStart().isValid() && journal->created().isValid() ) { | ||
1027 | journal->setDtStart( journal->created() ); | ||
1028 | } | ||
1026 | return journal; | 1029 | return journal; |
1027 | } | 1030 | } |
1028 | 1031 | ||
1029 | Attendee *ICalFormatImpl::readAttendee(icalproperty *attendee) | 1032 | Attendee *ICalFormatImpl::readAttendee(icalproperty *attendee) |
1030 | { | 1033 | { |
1031 | icalparameter *p = 0; | 1034 | icalparameter *p = 0; |
1032 | 1035 | ||
1033 | QString email = QString::fromUtf8(icalproperty_get_attendee(attendee)); | 1036 | QString email = QString::fromUtf8(icalproperty_get_attendee(attendee)); |
1034 | 1037 | ||
1035 | QString name; | 1038 | QString name; |
1036 | QString uid = QString::null; | 1039 | QString uid = QString::null; |
1037 | p = icalproperty_get_first_parameter(attendee,ICAL_CN_PARAMETER); | 1040 | p = icalproperty_get_first_parameter(attendee,ICAL_CN_PARAMETER); |
1038 | if (p) { | 1041 | if (p) { |
1039 | name = QString::fromUtf8(icalparameter_get_cn(p)); | 1042 | name = QString::fromUtf8(icalparameter_get_cn(p)); |
1040 | } else { | 1043 | } else { |
1041 | } | 1044 | } |
1042 | 1045 | ||
1043 | bool rsvp=false; | 1046 | bool rsvp=false; |
1044 | p = icalproperty_get_first_parameter(attendee,ICAL_RSVP_PARAMETER); | 1047 | p = icalproperty_get_first_parameter(attendee,ICAL_RSVP_PARAMETER); |
1045 | if (p) { | 1048 | if (p) { |
1046 | icalparameter_rsvp rsvpParameter = icalparameter_get_rsvp(p); | 1049 | icalparameter_rsvp rsvpParameter = icalparameter_get_rsvp(p); |
1047 | if (rsvpParameter == ICAL_RSVP_TRUE) rsvp = true; | 1050 | if (rsvpParameter == ICAL_RSVP_TRUE) rsvp = true; |
1048 | } | 1051 | } |
1049 | 1052 | ||
1050 | Attendee::PartStat status = Attendee::NeedsAction; | 1053 | Attendee::PartStat status = Attendee::NeedsAction; |
1051 | p = icalproperty_get_first_parameter(attendee,ICAL_PARTSTAT_PARAMETER); | 1054 | p = icalproperty_get_first_parameter(attendee,ICAL_PARTSTAT_PARAMETER); |
1052 | if (p) { | 1055 | if (p) { |
1053 | icalparameter_partstat partStatParameter = icalparameter_get_partstat(p); | 1056 | icalparameter_partstat partStatParameter = icalparameter_get_partstat(p); |
1054 | switch(partStatParameter) { | 1057 | switch(partStatParameter) { |
1055 | default: | 1058 | default: |
1056 | case ICAL_PARTSTAT_NEEDSACTION: | 1059 | case ICAL_PARTSTAT_NEEDSACTION: |
1057 | status = Attendee::NeedsAction; | 1060 | status = Attendee::NeedsAction; |
1058 | break; | 1061 | break; |
1059 | case ICAL_PARTSTAT_ACCEPTED: | 1062 | case ICAL_PARTSTAT_ACCEPTED: |
1060 | status = Attendee::Accepted; | 1063 | status = Attendee::Accepted; |
1061 | break; | 1064 | break; |
1062 | case ICAL_PARTSTAT_DECLINED: | 1065 | case ICAL_PARTSTAT_DECLINED: |
1063 | status = Attendee::Declined; | 1066 | status = Attendee::Declined; |
1064 | break; | 1067 | break; |
1065 | case ICAL_PARTSTAT_TENTATIVE: | 1068 | case ICAL_PARTSTAT_TENTATIVE: |
1066 | status = Attendee::Tentative; | 1069 | status = Attendee::Tentative; |
1067 | break; | 1070 | break; |
1068 | case ICAL_PARTSTAT_DELEGATED: | 1071 | case ICAL_PARTSTAT_DELEGATED: |
1069 | status = Attendee::Delegated; | 1072 | status = Attendee::Delegated; |
1070 | break; | 1073 | break; |
1071 | case ICAL_PARTSTAT_COMPLETED: | 1074 | case ICAL_PARTSTAT_COMPLETED: |
1072 | status = Attendee::Completed; | 1075 | status = Attendee::Completed; |
1073 | break; | 1076 | break; |