summaryrefslogtreecommitdiffabout
path: root/libkcal/vcalformat.cpp
Side-by-side diff
Diffstat (limited to 'libkcal/vcalformat.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/vcalformat.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp
index 59030d5..72a781a 100644
--- a/libkcal/vcalformat.cpp
+++ b/libkcal/vcalformat.cpp
@@ -303,99 +303,99 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent)
QString catStr;
for ( QStringList::Iterator it = tmpStrList.begin();
it != tmpStrList.end();
++it ) {
catStr = *it;
if (catStr[0] == ' ')
tmpStr += catStr.mid(1);
else
tmpStr += catStr;
// this must be a ';' character as the vCalendar specification requires!
// vcc.y has been hacked to translate the ';' to a ',' when the vcal is
// read in.
tmpStr += ";";
}
if (!tmpStr.isEmpty()) {
tmpStr.truncate(tmpStr.length()-1);
addPropValue(vtodo, VCCategoriesProp, tmpStr.local8Bit());
}
// alarm stuff
kdDebug(5800) << "vcalformat::eventToVTodo was called" << endl;
QPtrList<Alarm> alarms = anEvent->alarms();
Alarm* alarm;
for (alarm = alarms.first(); alarm; alarm = alarms.next()) {
if (alarm->enabled()) {
VObject *a = addProp(vtodo, VCDAlarmProp);
tmpStr = qDateTimeToISO(alarm->time());
addPropValue(a, VCRunTimeProp, tmpStr.local8Bit());
addPropValue(a, VCRepeatCountProp, "1");
addPropValue(a, VCDisplayStringProp, "beep!");
if (alarm->type() == Alarm::Audio) {
a = addProp(vtodo, VCAAlarmProp);
addPropValue(a, VCRunTimeProp, tmpStr.local8Bit());
addPropValue(a, VCRepeatCountProp, "1");
addPropValue(a, VCAudioContentProp, QFile::encodeName(alarm->audioFile()));
}
else if (alarm->type() == Alarm::Procedure) {
a = addProp(vtodo, VCPAlarmProp);
addPropValue(a, VCRunTimeProp, tmpStr.local8Bit());
addPropValue(a, VCRepeatCountProp, "1");
addPropValue(a, VCProcedureNameProp, QFile::encodeName(alarm->programFile()));
}
}
}
if (anEvent->pilotId()) {
// pilot sync stuff
tmpStr.sprintf("%i",anEvent->pilotId());
- addPropValue(vtodo, KPilotIdProp, tmpStr.local8Bit());
+ addPropValue(vtodo, XPilotIdProp, tmpStr.local8Bit());
tmpStr.sprintf("%i",anEvent->syncStatus());
- addPropValue(vtodo, KPilotStatusProp, tmpStr.local8Bit());
+ addPropValue(vtodo, XPilotStatusProp, tmpStr.local8Bit());
}
return vtodo;
}
VObject* VCalFormat::eventToVEvent(const Event *anEvent)
{
VObject *vevent;
QString tmpStr;
QStringList tmpStrList;
vevent = newVObject(VCEventProp);
// start and end time
tmpStr = qDateTimeToISO(anEvent->dtStart(),
!anEvent->doesFloat());
addPropValue(vevent, VCDTstartProp, tmpStr.local8Bit());
// events that have time associated but take up no time should
// not have both DTSTART and DTEND.
if (anEvent->dtStart() != anEvent->dtEnd()) {
tmpStr = qDateTimeToISO(anEvent->dtEnd(),
!anEvent->doesFloat());
addPropValue(vevent, VCDTendProp, tmpStr.local8Bit());
}
// creation date
tmpStr = qDateTimeToISO(anEvent->created());
addPropValue(vevent, VCDCreatedProp, tmpStr.local8Bit());
// unique id
addPropValue(vevent, VCUniqueStringProp,
anEvent->uid().local8Bit());
// revision
tmpStr.sprintf("%i", anEvent->revision());
addPropValue(vevent, VCSequenceProp, tmpStr.local8Bit());
// last modification date
tmpStr = qDateTimeToISO(anEvent->lastModified());
addPropValue(vevent, VCLastModifiedProp, tmpStr.local8Bit());
// attendee and organizer stuff
tmpStr = "MAILTO:" + anEvent->organizer();
addPropValue(vevent, ICOrganizerProp, tmpStr.local8Bit());
if (anEvent->attendeeCount() != 0) {
QPtrList<Attendee> al = anEvent->attendees();
@@ -481,97 +481,97 @@ VObject* VCalFormat::eventToVEvent(const Event *anEvent)
// write out all the rYearNums;
tmpDays = anEvent->recurrence()->yearNums();
for (tmpDay = tmpDays.first();
tmpDay;
tmpDay = tmpDays.next()) {
tmpStr2.sprintf("%i ", *tmpDay);
tmpStr += tmpStr2;
}
break;
case Recurrence::rYearlyDay:
tmpStr.sprintf("YD%i ", anEvent->recurrence()->frequency());
// write out all the rYearNums;
tmpDays = anEvent->recurrence()->yearNums();
for (tmpDay = tmpDays.first();
tmpDay;
tmpDay = tmpDays.next()) {
tmpStr2.sprintf("%i ", *tmpDay);
tmpStr += tmpStr2;
}
break;
default:
kdDebug(5800) << "ERROR, it should never get here in eventToVEvent!" << endl;
break;
} // switch
if (anEvent->recurrence()->duration() > 0) {
tmpStr2.sprintf("#%i",anEvent->recurrence()->duration());
tmpStr += tmpStr2;
} else if (anEvent->recurrence()->duration() == -1) {
tmpStr += "#0"; // defined as repeat forever
} else {
tmpStr += qDateTimeToISO(anEvent->recurrence()->endDate(), FALSE);
}
addPropValue(vevent,VCRRuleProp, tmpStr.local8Bit());
} // event repeats
// exceptions to recurrence
DateList dateList = anEvent->exDates();
DateList::ConstIterator it;
QString tmpStr2;
for (it = dateList.begin(); it != dateList.end(); ++it) {
tmpStr = qDateToISO(*it) + ";";
tmpStr2 += tmpStr;
}
if (!tmpStr2.isEmpty()) {
tmpStr2.truncate(tmpStr2.length()-1);
- addPropValue(vevent, VCExDateProp, tmpStr2.local8Bit());
+ addPropValue(vevent, VCExpDateProp, tmpStr2.local8Bit());
}
// description
if (!anEvent->description().isEmpty()) {
VObject *d = addPropValue(vevent, VCDescriptionProp,
anEvent->description().local8Bit());
if (anEvent->description().find('\n') != -1)
addProp(d, VCQuotedPrintableProp);
}
// summary
if (!anEvent->summary().isEmpty())
addPropValue(vevent, VCSummaryProp, anEvent->summary().local8Bit());
if (!anEvent->location().isEmpty())
addPropValue(vevent, VCLocationProp, anEvent->location().local8Bit());
// status
// TODO: define Event status
// addPropValue(vevent, VCStatusProp, anEvent->statusStr().local8Bit());
// secrecy
const char *text = 0;
switch (anEvent->secrecy()) {
case Incidence::SecrecyPublic:
text = "PUBLIC";
break;
case Incidence::SecrecyPrivate:
text = "PRIVATE";
break;
case Incidence::SecrecyConfidential:
text = "CONFIDENTIAL";
break;
}
if (text) {
addPropValue(vevent, VCClassProp, text);
}
// categories
tmpStrList = anEvent->categories();
tmpStr = "";
QString catStr;
for ( QStringList::Iterator it = tmpStrList.begin();
it != tmpStrList.end();
++it ) {
catStr = *it;
if (catStr[0] == ' ')
tmpStr += catStr.mid(1);
@@ -596,99 +596,99 @@ VObject* VCalFormat::eventToVEvent(const Event *anEvent)
// resources
tmpStrList = anEvent->resources();
tmpStr = tmpStrList.join(";");
if (!tmpStr.isEmpty())
addPropValue(vevent, VCResourcesProp, tmpStr.local8Bit());
// alarm stuff
QPtrList<Alarm> alarms = anEvent->alarms();
Alarm* alarm;
for (alarm = alarms.first(); alarm; alarm = alarms.next()) {
if (alarm->enabled()) {
VObject *a = addProp(vevent, VCDAlarmProp);
tmpStr = qDateTimeToISO(alarm->time());
addPropValue(a, VCRunTimeProp, tmpStr.local8Bit());
addPropValue(a, VCRepeatCountProp, "1");
addPropValue(a, VCDisplayStringProp, "beep!");
if (alarm->type() == Alarm::Audio) {
a = addProp(vevent, VCAAlarmProp);
addPropValue(a, VCRunTimeProp, tmpStr.local8Bit());
addPropValue(a, VCRepeatCountProp, "1");
addPropValue(a, VCAudioContentProp, QFile::encodeName(alarm->audioFile()));
}
if (alarm->type() == Alarm::Procedure) {
a = addProp(vevent, VCPAlarmProp);
addPropValue(a, VCRunTimeProp, tmpStr.local8Bit());
addPropValue(a, VCRepeatCountProp, "1");
addPropValue(a, VCProcedureNameProp, QFile::encodeName(alarm->programFile()));
}
}
}
// priority
tmpStr.sprintf("%i",anEvent->priority());
addPropValue(vevent, VCPriorityProp, tmpStr.local8Bit());
// transparency
tmpStr.sprintf("%i",anEvent->transparency());
addPropValue(vevent, VCTranspProp, tmpStr.local8Bit());
// related event
if (anEvent->relatedTo()) {
addPropValue(vevent, VCRelatedToProp,
anEvent->relatedTo()->uid().local8Bit());
}
if (anEvent->pilotId()) {
// pilot sync stuff
tmpStr.sprintf("%i",anEvent->pilotId());
- addPropValue(vevent, KPilotIdProp, tmpStr.local8Bit());
+ addPropValue(vevent, XPilotIdProp, tmpStr.local8Bit());
tmpStr.sprintf("%i",anEvent->syncStatus());
- addPropValue(vevent, KPilotStatusProp, tmpStr.local8Bit());
+ addPropValue(vevent, XPilotStatusProp, tmpStr.local8Bit());
}
return vevent;
}
Todo *VCalFormat::VTodoToEvent(VObject *vtodo)
{
VObject *vo;
VObjectIterator voi;
char *s;
Todo *anEvent = new Todo;
// creation date
if ((vo = isAPropertyOf(vtodo, VCDCreatedProp)) != 0) {
anEvent->setCreated(ISOToQDateTime(s = fakeCString(vObjectUStringZValue(vo))));
deleteStr(s);
}
// unique id
vo = isAPropertyOf(vtodo, VCUniqueStringProp);
// while the UID property is preferred, it is not required. We'll use the
// default Event UID if none is given.
if (vo) {
anEvent->setUid(s = fakeCString(vObjectUStringZValue(vo)));
deleteStr(s);
}
// last modification date
if ((vo = isAPropertyOf(vtodo, VCLastModifiedProp)) != 0) {
anEvent->setLastModified(ISOToQDateTime(s = fakeCString(vObjectUStringZValue(vo))));
deleteStr(s);
}
else
anEvent->setLastModified(QDateTime(QDate::currentDate(),
QTime::currentTime()));
// organizer
// if our extension property for the event's ORGANIZER exists, add it.
if ((vo = isAPropertyOf(vtodo, ICOrganizerProp)) != 0) {
anEvent->setOrganizer(s = fakeCString(vObjectUStringZValue(vo)));
deleteStr(s);
} else {
anEvent->setOrganizer(mCalendar->getEmail());
}
// attendees.
initPropIterator(&voi, vtodo);
@@ -804,104 +804,104 @@ Todo *VCalFormat::VTodoToEvent(VObject *vtodo)
}
alarm->setEnabled(true);
if ((vo = isAPropertyOf(vtodo, VCPAlarmProp))) {
if ((a = isAPropertyOf(vo, VCProcedureNameProp))) {
s = fakeCString(vObjectUStringZValue(a));
alarm->setProcedureAlarm(QFile::decodeName(s));
deleteStr(s);
}
}
if ((vo = isAPropertyOf(vtodo, VCAAlarmProp))) {
if ((a = isAPropertyOf(vo, VCAudioContentProp))) {
s = fakeCString(vObjectUStringZValue(a));
alarm->setAudioAlarm(QFile::decodeName(s));
deleteStr(s);
}
}
}
// related todo
if ((vo = isAPropertyOf(vtodo, VCRelatedToProp)) != 0) {
anEvent->setRelatedToUid(s = fakeCString(vObjectUStringZValue(vo)));
deleteStr(s);
mTodosRelate.append(anEvent);
}
// categories
QStringList tmpStrList;
int index1 = 0;
int index2 = 0;
if ((vo = isAPropertyOf(vtodo, VCCategoriesProp)) != 0) {
s = fakeCString(vObjectUStringZValue(vo));
QString categories = QString::fromLocal8Bit(s);
deleteStr(s);
//const char* category;
QString category;
while ((index2 = categories.find(',', index1)) != -1) {
//category = (const char *) categories.mid(index1, (index2 - index1));
category = categories.mid(index1, (index2 - index1));
tmpStrList.append(category);
index1 = index2+1;
}
// get last category
category = categories.mid(index1, (categories.length()-index1));
tmpStrList.append(category);
anEvent->setCategories(tmpStrList);
}
/* PILOT SYNC STUFF */
- if ((vo = isAPropertyOf(vtodo, KPilotIdProp))) {
+ if ((vo = isAPropertyOf(vtodo, XPilotIdProp))) {
anEvent->setPilotId(atoi(s = fakeCString(vObjectUStringZValue(vo))));
deleteStr(s);
}
else
anEvent->setPilotId(0);
- if ((vo = isAPropertyOf(vtodo, KPilotStatusProp))) {
+ if ((vo = isAPropertyOf(vtodo, XPilotStatusProp))) {
anEvent->setSyncStatus(atoi(s = fakeCString(vObjectUStringZValue(vo))));
deleteStr(s);
}
else
anEvent->setSyncStatus(Event::SYNCMOD);
return anEvent;
}
Event* VCalFormat::VEventToEvent(VObject *vevent)
{
VObject *vo;
VObjectIterator voi;
char *s;
Event *anEvent = new Event;
// creation date
if ((vo = isAPropertyOf(vevent, VCDCreatedProp)) != 0) {
anEvent->setCreated(ISOToQDateTime(s = fakeCString(vObjectUStringZValue(vo))));
deleteStr(s);
}
// unique id
vo = isAPropertyOf(vevent, VCUniqueStringProp);
// while the UID property is preferred, it is not required. We'll use the
// default Event UID if none is given.
if (vo) {
anEvent->setUid(s = fakeCString(vObjectUStringZValue(vo)));
deleteStr(s);
}
// revision
// again NSCAL doesn't give us much to work with, so we improvise...
if ((vo = isAPropertyOf(vevent, VCSequenceProp)) != 0) {
anEvent->setRevision(atoi(s = fakeCString(vObjectUStringZValue(vo))));
deleteStr(s);
}
else
anEvent->setRevision(0);
// last modification date
if ((vo = isAPropertyOf(vevent, VCLastModifiedProp)) != 0) {
anEvent->setLastModified(ISOToQDateTime(s = fakeCString(vObjectUStringZValue(vo))));
deleteStr(s);
}
else
anEvent->setLastModified(QDateTime(QDate::currentDate(),
@@ -1162,97 +1162,97 @@ Event* VCalFormat::VEventToEvent(VObject *vevent)
} else {
int rDuration = tmpStr.mid(index, tmpStr.length()-index).toInt();
if (rDuration == 0)
anEvent->recurrence()->setYearly(Recurrence::rYearlyMonth, rFreq, -1);
else
anEvent->recurrence()->setYearly(Recurrence::rYearlyMonth, rFreq, rDuration);
}
}
/*********************** YEARLY-BY-DAY *********************************/
else if (tmpStr.left(2) == "YD") {
int index = tmpStr.find(' ');
int last = tmpStr.findRev(' ') + 1;
int rFreq = tmpStr.mid(2, (index-1)).toInt();
index += 1;
short tmpDay;
if( index == last ) {
// e.g. YD1 #0
tmpDay = anEvent->dtStart().date().dayOfYear();
anEvent->recurrence()->addYearlyNum(tmpDay);
}
else {
// e.g. YD1 123 #0
while (index < last) {
int index2 = tmpStr.find(' ', index);
tmpDay = tmpStr.mid(index, (index2-index)).toShort();
index = index2+1;
anEvent->recurrence()->addYearlyNum(tmpDay);
} // while != #
}
index = last; if (tmpStr.mid(index,1) == "#") index++;
if (tmpStr.find('T', index) != -1) {
QDate rEndDate = (ISOToQDateTime(tmpStr.mid(index, tmpStr.length()-index))).date();
anEvent->recurrence()->setYearly(Recurrence::rYearlyDay, rFreq, rEndDate);
} else {
int rDuration = tmpStr.mid(index, tmpStr.length()-index).toInt();
if (rDuration == 0)
anEvent->recurrence()->setYearly(Recurrence::rYearlyDay, rFreq, -1);
else
anEvent->recurrence()->setYearly(Recurrence::rYearlyDay, rFreq, rDuration);
}
} else {
kdDebug(5800) << "we don't understand this type of recurrence!" << endl;
} // if
} // repeats
// recurrence exceptions
- if ((vo = isAPropertyOf(vevent, VCExDateProp)) != 0) {
+ if ((vo = isAPropertyOf(vevent, VCExpDateProp)) != 0) {
s = fakeCString(vObjectUStringZValue(vo));
QStringList exDates = QStringList::split(",",s);
QStringList::ConstIterator it;
for(it = exDates.begin(); it != exDates.end(); ++it ) {
anEvent->addExDate(ISOToQDate(*it));
}
deleteStr(s);
}
// summary
if ((vo = isAPropertyOf(vevent, VCSummaryProp))) {
s = fakeCString(vObjectUStringZValue(vo));
anEvent->setSummary(QString::fromLocal8Bit(s));
deleteStr(s);
}
if ((vo = isAPropertyOf(vevent, VCLocationProp))) {
s = fakeCString(vObjectUStringZValue(vo));
anEvent->setLocation(QString::fromLocal8Bit(s));
deleteStr(s);
}
// description
if ((vo = isAPropertyOf(vevent, VCDescriptionProp)) != 0) {
s = fakeCString(vObjectUStringZValue(vo));
if (!anEvent->description().isEmpty()) {
anEvent->setDescription(anEvent->description() + "\n" +
QString::fromLocal8Bit(s));
} else {
anEvent->setDescription(QString::fromLocal8Bit(s));
}
deleteStr(s);
}
// some stupid vCal exporters ignore the standard and use Description
// instead of Summary for the default field. Correct for this.
if (anEvent->summary().isEmpty() &&
!(anEvent->description().isEmpty())) {
QString tmpStr = anEvent->description().simplifyWhiteSpace();
anEvent->setDescription("");
anEvent->setSummary(tmpStr);
}
#if 0
// status
if ((vo = isAPropertyOf(vevent, VCStatusProp)) != 0) {
QString tmpStr(s = fakeCString(vObjectUStringZValue(vo)));
deleteStr(s);
// TODO: Define Event status
@@ -1326,104 +1326,104 @@ Event* VCalFormat::VEventToEvent(VObject *vevent)
}
/* alarm stuff */
if ((vo = isAPropertyOf(vevent, VCDAlarmProp))) {
Alarm* alarm = anEvent->newAlarm();
VObject *a;
if ((a = isAPropertyOf(vo, VCRunTimeProp))) {
alarm->setTime(ISOToQDateTime(s = fakeCString(vObjectUStringZValue(a))));
deleteStr(s);
}
alarm->setEnabled(true);
if ((vo = isAPropertyOf(vevent, VCPAlarmProp))) {
if ((a = isAPropertyOf(vo, VCProcedureNameProp))) {
s = fakeCString(vObjectUStringZValue(a));
alarm->setProcedureAlarm(QFile::decodeName(s));
deleteStr(s);
}
}
if ((vo = isAPropertyOf(vevent, VCAAlarmProp))) {
if ((a = isAPropertyOf(vo, VCAudioContentProp))) {
s = fakeCString(vObjectUStringZValue(a));
alarm->setAudioAlarm(QFile::decodeName(s));
deleteStr(s);
}
}
}
// priority
if ((vo = isAPropertyOf(vevent, VCPriorityProp))) {
anEvent->setPriority(atoi(s = fakeCString(vObjectUStringZValue(vo))));
deleteStr(s);
}
// transparency
if ((vo = isAPropertyOf(vevent, VCTranspProp)) != 0) {
int i = atoi(s = fakeCString(vObjectUStringZValue(vo)));
anEvent->setTransparency( i == 1 ? Event::Transparent : Event::Opaque );
deleteStr(s);
}
// related event
if ((vo = isAPropertyOf(vevent, VCRelatedToProp)) != 0) {
anEvent->setRelatedToUid(s = fakeCString(vObjectUStringZValue(vo)));
deleteStr(s);
mEventsRelate.append(anEvent);
}
/* PILOT SYNC STUFF */
- if ((vo = isAPropertyOf(vevent, KPilotIdProp))) {
+ if ((vo = isAPropertyOf(vevent, XPilotIdProp))) {
anEvent->setPilotId(atoi(s = fakeCString(vObjectUStringZValue(vo))));
deleteStr(s);
}
else
anEvent->setPilotId(0);
- if ((vo = isAPropertyOf(vevent, KPilotStatusProp))) {
+ if ((vo = isAPropertyOf(vevent, XPilotStatusProp))) {
anEvent->setSyncStatus(atoi(s = fakeCString(vObjectUStringZValue(vo))));
deleteStr(s);
}
else
anEvent->setSyncStatus(Event::SYNCMOD);
return anEvent;
}
QString VCalFormat::qDateToISO(const QDate &qd)
{
QString tmpStr;
ASSERT(qd.isValid());
tmpStr.sprintf("%.2d%.2d%.2d",
qd.year(), qd.month(), qd.day());
return tmpStr;
}
QString VCalFormat::qDateTimeToISO(const QDateTime &qdt, bool zulu)
{
QString tmpStr;
ASSERT(qdt.date().isValid());
ASSERT(qdt.time().isValid());
if (zulu) {
QDateTime tmpDT(qdt);
tmpDT = tmpDT.addSecs(60*(-mCalendar->getTimeZone())); // correct to GMT.
tmpStr.sprintf("%.2d%.2d%.2dT%.2d%.2d%.2dZ",
tmpDT.date().year(), tmpDT.date().month(),
tmpDT.date().day(), tmpDT.time().hour(),
tmpDT.time().minute(), tmpDT.time().second());
} else {
tmpStr.sprintf("%.2d%.2d%.2dT%.2d%.2d%.2d",
qdt.date().year(), qdt.date().month(),
qdt.date().day(), qdt.time().hour(),
qdt.time().minute(), qdt.time().second());
}
return tmpStr;
}
QDateTime VCalFormat::ISOToQDateTime(const QString & dtStr)
{
QDate tmpDate;
QTime tmpTime;
@@ -1477,97 +1477,97 @@ void VCalFormat::populate(VObject *vcal)
methodType = fakeCString(vObjectUStringZValue(curVO));
kdDebug() << "This calendar is an iTIP transaction of type '"
<< methodType << "'" << endl;
delete methodType;
}
// warn the user that we might have trouble reading non-known calendar.
if ((curVO = isAPropertyOf(vcal, VCProdIdProp)) != 0) {
char *s = fakeCString(vObjectUStringZValue(curVO));
if (strcmp(productId().local8Bit(), s) != 0)
kdDebug() << "This vCalendar file was not created by KOrganizer "
"or any other product we support. Loading anyway..." << endl;
mLoadedProductId = s;
deleteStr(s);
}
// warn the user we might have trouble reading this unknown version.
if ((curVO = isAPropertyOf(vcal, VCVersionProp)) != 0) {
char *s = fakeCString(vObjectUStringZValue(curVO));
if (strcmp(_VCAL_VERSION, s) != 0)
kdDebug() << "This vCalendar file has version " << s
<< "We only support " << _VCAL_VERSION << endl;
deleteStr(s);
}
// set the time zone
if ((curVO = isAPropertyOf(vcal, VCTimeZoneProp)) != 0) {
char *s = fakeCString(vObjectUStringZValue(curVO));
mCalendar->setTimeZone(s);
deleteStr(s);
}
// Store all events with a relatedTo property in a list for post-processing
mEventsRelate.clear();
mTodosRelate.clear();
initPropIterator(&i, vcal);
// go through all the vobjects in the vcal
while (moreIteration(&i)) {
curVO = nextVObject(&i);
/************************************************************************/
// now, check to see that the object is an event or todo.
if (strcmp(vObjectName(curVO), VCEventProp) == 0) {
- if ((curVOProp = isAPropertyOf(curVO, KPilotStatusProp)) != 0) {
+ if ((curVOProp = isAPropertyOf(curVO, XPilotStatusProp)) != 0) {
char *s;
s = fakeCString(vObjectUStringZValue(curVOProp));
// check to see if event was deleted by the kpilot conduit
if (atoi(s) == Event::SYNCDEL) {
deleteStr(s);
kdDebug(5800) << "skipping pilot-deleted event" << endl;
goto SKIP;
}
deleteStr(s);
}
// this code checks to see if we are trying to read in an event
// that we already find to be in the calendar. If we find this
// to be the case, we skip the event.
if ((curVOProp = isAPropertyOf(curVO, VCUniqueStringProp)) != 0) {
char *s = fakeCString(vObjectUStringZValue(curVOProp));
QString tmpStr(s);
deleteStr(s);
if (mCalendar->event(tmpStr)) {
goto SKIP;
}
if (mCalendar->todo(tmpStr)) {
goto SKIP;
}
}
if ((!(curVOProp = isAPropertyOf(curVO, VCDTstartProp))) &&
(!(curVOProp = isAPropertyOf(curVO, VCDTendProp)))) {
kdDebug(5800) << "found a VEvent with no DTSTART and no DTEND! Skipping..." << endl;
goto SKIP;
}
anEvent = VEventToEvent(curVO);
// we now use addEvent instead of insertEvent so that the
// signal/slot get connected.
if (anEvent) {
if ( !anEvent->dtStart().isValid() || !anEvent->dtEnd().isValid() ) {
kdDebug() << "VCalFormat::populate(): Event has invalid dates."
<< endl;
} else {
mCalendar->addEvent(anEvent);
}
} else {
// some sort of error must have occurred while in translation.
goto SKIP;
}
} else if (strcmp(vObjectName(curVO), VCTodoProp) == 0) {