summaryrefslogtreecommitdiffabout
path: root/libkcal
Side-by-side diff
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/vcalformat.cpp39
-rw-r--r--libkcal/vcalformat.h3
-rw-r--r--libkcal/versit/vcc.c3
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)
VObject *aProp = addPropValue(vtodo, VCAttendeeProp, tmpStr.local8Bit());
+ addPropValue(aProp, VCRoleProp, writeRole(curAttendee->role()));
addPropValue(aProp, VCRSVPProp, curAttendee->RSVP() ? "TRUE" : "FALSE");
@@ -454,3 +455,4 @@ VObject* VCalFormat::eventToVEvent(const Event *anEvent)
VObject *aProp = addPropValue(vevent, VCAttendeeProp, tmpStr.local8Bit());
- addPropValue(aProp, VCRSVPProp, curAttendee->RSVP() ? "TRUE" : "FALSE");;
+ addPropValue(aProp, VCRoleProp, writeRole(curAttendee->role()));
+ addPropValue(aProp, VCRSVPProp, curAttendee->RSVP() ? "TRUE" : "FALSE");
addPropValue(aProp, VCStatusProp, writeStatus(curAttendee->status()));
@@ -753,6 +755,8 @@ Todo *VCalFormat::VTodoToEvent(VObject *vtodo)
// just a name
- QString email = tmpStr.replace( QRegExp(" "), "." );
- a = new Attendee(tmpStr,email);
+ // QString email = tmpStr.replace( QRegExp(" "), "." );
+ a = new Attendee(tmpStr,0);
}
-
+ // is there a Role property?
+ if ((vp = isAPropertyOf(vo, VCRoleProp)) != 0)
+ a->setRole(readRole(vObjectStringZValue(vp)));
// is there an RSVP property?
@@ -979,6 +983,11 @@ Event* VCalFormat::VEventToEvent(VObject *vevent)
// just a name
- QString email = tmpStr.replace( QRegExp(" "), "." );
- a = new Attendee(tmpStr,email);
+ //QString email = tmpStr.replace( QRegExp(" "), "." );
+ a = new Attendee(tmpStr,0);
}
+
+ // is there a Role property?
+ if ((vp = isAPropertyOf(vo, VCRoleProp)) != 0)
+ a->setRole(readRole(vObjectStringZValue(vp)));
+
// is there an RSVP property?
@@ -1660,3 +1669,21 @@ int VCalFormat::numFromDay(const QString &day)
}
+Attendee::Role VCalFormat::readRole(const char *s) const
+{
+ QString statStr = s;
+ statStr = statStr.upper();
+ Attendee::Role role = Attendee::ReqParticipant;
+
+ if ( statStr == "OWNER")
+ role = Attendee::Chair;
+ // enum Role { ReqParticipant, OptParticipant, NonParticipant, Chair };
+
+ return role;
+}
+QCString VCalFormat::writeRole(Attendee::Role role) const
+{
+ if ( role == Attendee::Chair )
+ return "OWNER";
+ return "ATTENDEE";
+}
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 {
int numFromDay(const QString &day);
-
+ Attendee::Role VCalFormat::readRole(const char *s) const;
+ QCString writeRole(Attendee::Role role) const;
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() {
c = lexLookahead();
- while (c != EOF && !strchr("\t\n ;:=",c)) {
+ // LR while (c != EOF && !strchr("\t\n ;:=",c)) {
+ while (c != EOF && !strchr("\t\n;:=",c)) {
lexAppendc(c);