summaryrefslogtreecommitdiffabout
path: root/libkcal/vcalformat.cpp
Unidiff
Diffstat (limited to 'libkcal/vcalformat.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/vcalformat.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp
index 8efc1ea..2e19740 100644
--- a/libkcal/vcalformat.cpp
+++ b/libkcal/vcalformat.cpp
@@ -371,49 +371,49 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent)
371 a = addProp(vtodo, VCPAlarmProp); 371 a = addProp(vtodo, VCPAlarmProp);
372 addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); 372 addPropValue(a, VCRunTimeProp, tmpStr.local8Bit());
373 addPropValue(a, VCRepeatCountProp, "1"); 373 addPropValue(a, VCRepeatCountProp, "1");
374 addPropValue(a, VCProcedureNameProp, QFile::encodeName(alarm->programFile())); 374 addPropValue(a, VCProcedureNameProp, QFile::encodeName(alarm->programFile()));
375 } else { 375 } else {
376 a = addProp(vtodo, VCDAlarmProp); 376 a = addProp(vtodo, VCDAlarmProp);
377 addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); 377 addPropValue(a, VCRunTimeProp, tmpStr.local8Bit());
378 addPropValue(a, VCRepeatCountProp, "1"); 378 addPropValue(a, VCRepeatCountProp, "1");
379 addPropValue(a, VCDisplayStringProp, "beep!"); 379 addPropValue(a, VCDisplayStringProp, "beep!");
380 } 380 }
381 } 381 }
382 } 382 }
383 383
384 if (anEvent->pilotId()) { 384 if (anEvent->pilotId()) {
385 // pilot sync stuff 385 // pilot sync stuff
386 tmpStr.sprintf("%i",anEvent->pilotId()); 386 tmpStr.sprintf("%i",anEvent->pilotId());
387 addPropValue(vtodo, XPilotIdProp, tmpStr.local8Bit()); 387 addPropValue(vtodo, XPilotIdProp, tmpStr.local8Bit());
388 tmpStr.sprintf("%i",anEvent->syncStatus()); 388 tmpStr.sprintf("%i",anEvent->syncStatus());
389 addPropValue(vtodo, XPilotStatusProp, tmpStr.local8Bit()); 389 addPropValue(vtodo, XPilotStatusProp, tmpStr.local8Bit());
390 } 390 }
391 391
392 return vtodo; 392 return vtodo;
393} 393}
394 394
395VObject* VCalFormat::eventToVEvent(const Event *anEvent) 395VObject* VCalFormat::eventToVEvent(Event *anEvent)
396{ 396{
397 VObject *vevent; 397 VObject *vevent;
398 QString tmpStr; 398 QString tmpStr;
399 399
400 vevent = newVObject(VCEventProp); 400 vevent = newVObject(VCEventProp);
401 401
402 // start and end time 402 // start and end time
403 tmpStr = qDateTimeToISO(anEvent->dtStart(), 403 tmpStr = qDateTimeToISO(anEvent->dtStart(),
404 !anEvent->doesFloat()); 404 !anEvent->doesFloat());
405 addPropValue(vevent, VCDTstartProp, tmpStr.local8Bit()); 405 addPropValue(vevent, VCDTstartProp, tmpStr.local8Bit());
406 406
407 // events that have time associated but take up no time should 407 // events that have time associated but take up no time should
408 // not have both DTSTART and DTEND. 408 // not have both DTSTART and DTEND.
409 if (anEvent->dtStart() != anEvent->dtEnd()) { 409 if (anEvent->dtStart() != anEvent->dtEnd()) {
410 tmpStr = qDateTimeToISO(anEvent->dtEnd(), 410 tmpStr = qDateTimeToISO(anEvent->dtEnd(),
411 !anEvent->doesFloat()); 411 !anEvent->doesFloat());
412 addPropValue(vevent, VCDTendProp, tmpStr.local8Bit()); 412 addPropValue(vevent, VCDTendProp, tmpStr.local8Bit());
413 } 413 }
414 414
415 // creation date 415 // creation date
416 tmpStr = qDateTimeToISO(anEvent->created()); 416 tmpStr = qDateTimeToISO(anEvent->created());
417 addPropValue(vevent, VCDCreatedProp, tmpStr.local8Bit()); 417 addPropValue(vevent, VCDCreatedProp, tmpStr.local8Bit());
418 418
419 // unique id 419 // unique id
@@ -438,49 +438,49 @@ VObject* VCalFormat::eventToVEvent(const Event *anEvent)
438 Attendee *curAttendee; 438 Attendee *curAttendee;
439 439
440 // TODO: Put this functionality into Attendee class 440 // TODO: Put this functionality into Attendee class
441 for (; ai.current(); ++ai) { 441 for (; ai.current(); ++ai) {
442 curAttendee = ai.current(); 442 curAttendee = ai.current();
443 if (!curAttendee->email().isEmpty() && 443 if (!curAttendee->email().isEmpty() &&
444 !curAttendee->name().isEmpty()) 444 !curAttendee->name().isEmpty())
445 tmpStr = "MAILTO:" + curAttendee->name() + " <" + 445 tmpStr = "MAILTO:" + curAttendee->name() + " <" +
446 curAttendee->email() + ">"; 446 curAttendee->email() + ">";
447 else if (curAttendee->name().isEmpty()) 447 else if (curAttendee->name().isEmpty())
448 tmpStr = "MAILTO: " + curAttendee->email(); 448 tmpStr = "MAILTO: " + curAttendee->email();
449 else if (curAttendee->email().isEmpty()) 449 else if (curAttendee->email().isEmpty())
450 tmpStr = "MAILTO: " + curAttendee->name(); 450 tmpStr = "MAILTO: " + curAttendee->name();
451 else if (curAttendee->name().isEmpty() && 451 else if (curAttendee->name().isEmpty() &&
452 curAttendee->email().isEmpty()) 452 curAttendee->email().isEmpty())
453 kdDebug(5800) << "warning! this Event has an attendee w/o name or email!" << endl; 453 kdDebug(5800) << "warning! this Event has an attendee w/o name or email!" << endl;
454 VObject *aProp = addPropValue(vevent, VCAttendeeProp, tmpStr.local8Bit()); 454 VObject *aProp = addPropValue(vevent, VCAttendeeProp, tmpStr.local8Bit());
455 addPropValue(aProp, VCRoleProp, writeRole(curAttendee->role())); 455 addPropValue(aProp, VCRoleProp, writeRole(curAttendee->role()));
456 addPropValue(aProp, VCRSVPProp, curAttendee->RSVP() ? "TRUE" : "FALSE"); 456 addPropValue(aProp, VCRSVPProp, curAttendee->RSVP() ? "TRUE" : "FALSE");
457 addPropValue(aProp, VCStatusProp, writeStatus(curAttendee->status())); 457 addPropValue(aProp, VCStatusProp, writeStatus(curAttendee->status()));
458 } 458 }
459 } 459 }
460 460
461 // recurrence rule stuff 461 // recurrence rule stuff
462 if (anEvent->recurrence()->doesRecur()) { 462 if (anEvent->doesRecur()) {
463 // some more variables 463 // some more variables
464 QPtrList<Recurrence::rMonthPos> tmpPositions; 464 QPtrList<Recurrence::rMonthPos> tmpPositions;
465 QPtrList<int> tmpDays; 465 QPtrList<int> tmpDays;
466 int *tmpDay; 466 int *tmpDay;
467 Recurrence::rMonthPos *tmpPos; 467 Recurrence::rMonthPos *tmpPos;
468 QString tmpStr2; 468 QString tmpStr2;
469 int i; 469 int i;
470 470
471 switch(anEvent->recurrence()->doesRecur()) { 471 switch(anEvent->recurrence()->doesRecur()) {
472 case Recurrence::rDaily: 472 case Recurrence::rDaily:
473 tmpStr.sprintf("D%i ",anEvent->recurrence()->frequency()); 473 tmpStr.sprintf("D%i ",anEvent->recurrence()->frequency());
474// if (anEvent->rDuration > 0) 474// if (anEvent->rDuration > 0)
475 //tmpStr += "#"; 475 //tmpStr += "#";
476 break; 476 break;
477 case Recurrence::rWeekly: 477 case Recurrence::rWeekly:
478 tmpStr.sprintf("W%i ",anEvent->recurrence()->frequency()); 478 tmpStr.sprintf("W%i ",anEvent->recurrence()->frequency());
479 for (i = 0; i < 7; i++) { 479 for (i = 0; i < 7; i++) {
480 if (anEvent->recurrence()->days().testBit(i)) 480 if (anEvent->recurrence()->days().testBit(i))
481 tmpStr += dayFromNum(i); 481 tmpStr += dayFromNum(i);
482 } 482 }
483 break; 483 break;
484 case Recurrence::rMonthlyPos: 484 case Recurrence::rMonthlyPos:
485 tmpStr.sprintf("MP%i ", anEvent->recurrence()->frequency()); 485 tmpStr.sprintf("MP%i ", anEvent->recurrence()->frequency());
486 // write out all rMonthPos's 486 // write out all rMonthPos's