author | zautrix <zautrix> | 2004-10-25 15:27:39 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-25 15:27:39 (UTC) |
commit | 03ca6830a9e6742b8873aee04d77b3e094b65d30 (patch) (unidiff) | |
tree | 170ab278ffeb371aae783815101f64275cd30c53 | |
parent | 62e92aa86b6281b4e4c2a2bdb57f3ceb5a87f4e3 (diff) | |
download | kdepimpi-03ca6830a9e6742b8873aee04d77b3e094b65d30.zip kdepimpi-03ca6830a9e6742b8873aee04d77b3e094b65d30.tar.gz kdepimpi-03ca6830a9e6742b8873aee04d77b3e094b65d30.tar.bz2 |
fix of vcal crash
-rw-r--r-- | libkcal/vcalformat.cpp | 39 | ||||
-rw-r--r-- | libkcal/vcalformat.h | 3 | ||||
-rw-r--r-- | libkcal/versit/vcc.c | 3 |
3 files changed, 37 insertions, 8 deletions
diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp index df93209..223aa5a 100644 --- a/libkcal/vcalformat.cpp +++ b/libkcal/vcalformat.cpp | |||
@@ -291,2 +291,3 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent) | |||
291 | VObject *aProp = addPropValue(vtodo, VCAttendeeProp, tmpStr.local8Bit()); | 291 | VObject *aProp = addPropValue(vtodo, VCAttendeeProp, tmpStr.local8Bit()); |
292 | addPropValue(aProp, VCRoleProp, writeRole(curAttendee->role())); | ||
292 | addPropValue(aProp, VCRSVPProp, curAttendee->RSVP() ? "TRUE" : "FALSE"); | 293 | addPropValue(aProp, VCRSVPProp, curAttendee->RSVP() ? "TRUE" : "FALSE"); |
@@ -454,3 +455,4 @@ VObject* VCalFormat::eventToVEvent(const Event *anEvent) | |||
454 | VObject *aProp = addPropValue(vevent, VCAttendeeProp, tmpStr.local8Bit()); | 455 | VObject *aProp = addPropValue(vevent, VCAttendeeProp, tmpStr.local8Bit()); |
455 | addPropValue(aProp, VCRSVPProp, curAttendee->RSVP() ? "TRUE" : "FALSE");; | 456 | addPropValue(aProp, VCRoleProp, writeRole(curAttendee->role())); |
457 | addPropValue(aProp, VCRSVPProp, curAttendee->RSVP() ? "TRUE" : "FALSE"); | ||
456 | addPropValue(aProp, VCStatusProp, writeStatus(curAttendee->status())); | 458 | addPropValue(aProp, VCStatusProp, writeStatus(curAttendee->status())); |
@@ -753,6 +755,8 @@ Todo *VCalFormat::VTodoToEvent(VObject *vtodo) | |||
753 | // just a name | 755 | // just a name |
754 | QString email = tmpStr.replace( QRegExp(" "), "." ); | 756 | // QString email = tmpStr.replace( QRegExp(" "), "." ); |
755 | a = new Attendee(tmpStr,email); | 757 | a = new Attendee(tmpStr,0); |
756 | } | 758 | } |
757 | 759 | // is there a Role property? | |
760 | if ((vp = isAPropertyOf(vo, VCRoleProp)) != 0) | ||
761 | a->setRole(readRole(vObjectStringZValue(vp))); | ||
758 | // is there an RSVP property? | 762 | // is there an RSVP property? |
@@ -979,6 +983,11 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) | |||
979 | // just a name | 983 | // just a name |
980 | QString email = tmpStr.replace( QRegExp(" "), "." ); | 984 | //QString email = tmpStr.replace( QRegExp(" "), "." ); |
981 | a = new Attendee(tmpStr,email); | 985 | a = new Attendee(tmpStr,0); |
982 | } | 986 | } |
983 | 987 | ||
988 | |||
989 | // is there a Role property? | ||
990 | if ((vp = isAPropertyOf(vo, VCRoleProp)) != 0) | ||
991 | a->setRole(readRole(vObjectStringZValue(vp))); | ||
992 | |||
984 | // is there an RSVP property? | 993 | // is there an RSVP property? |
@@ -1660,3 +1669,21 @@ int VCalFormat::numFromDay(const QString &day) | |||
1660 | } | 1669 | } |
1670 | Attendee::Role VCalFormat::readRole(const char *s) const | ||
1671 | { | ||
1672 | QString statStr = s; | ||
1673 | statStr = statStr.upper(); | ||
1674 | Attendee::Role role = Attendee::ReqParticipant; | ||
1675 | |||
1676 | if ( statStr == "OWNER") | ||
1677 | role = Attendee::Chair; | ||
1678 | // enum Role { ReqParticipant, OptParticipant, NonParticipant, Chair }; | ||
1679 | |||
1680 | return role; | ||
1681 | } | ||
1661 | 1682 | ||
1683 | QCString VCalFormat::writeRole(Attendee::Role role) const | ||
1684 | { | ||
1685 | if ( role == Attendee::Chair ) | ||
1686 | return "OWNER"; | ||
1687 | return "ATTENDEE"; | ||
1688 | } | ||
1662 | Attendee::PartStat VCalFormat::readStatus(const char *s) const | 1689 | Attendee::PartStat VCalFormat::readStatus(const char *s) const |
diff --git a/libkcal/vcalformat.h b/libkcal/vcalformat.h index 5bef7ed..c7df017 100644 --- a/libkcal/vcalformat.h +++ b/libkcal/vcalformat.h | |||
@@ -97,3 +97,4 @@ class VCalFormat : public CalFormat { | |||
97 | int numFromDay(const QString &day); | 97 | int numFromDay(const QString &day); |
98 | 98 | Attendee::Role VCalFormat::readRole(const char *s) const; | |
99 | QCString writeRole(Attendee::Role role) const; | ||
99 | Attendee::PartStat readStatus(const char *s) const; | 100 | Attendee::PartStat readStatus(const char *s) const; |
diff --git a/libkcal/versit/vcc.c b/libkcal/versit/vcc.c index 9be752d..5413813 100644 --- a/libkcal/versit/vcc.c +++ b/libkcal/versit/vcc.c | |||
@@ -1764,3 +1764,4 @@ static char* lexGetWord() { | |||
1764 | c = lexLookahead(); | 1764 | c = lexLookahead(); |
1765 | while (c != EOF && !strchr("\t\n ;:=",c)) { | 1765 | // LR while (c != EOF && !strchr("\t\n ;:=",c)) { |
1766 | while (c != EOF && !strchr("\t\n;:=",c)) { | ||
1766 | lexAppendc(c); | 1767 | lexAppendc(c); |