-rw-r--r-- | libkcal/icalformat.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libkcal/icalformat.cpp b/libkcal/icalformat.cpp index 5893db5..f2e7dfc 100644 --- a/libkcal/icalformat.cpp +++ b/libkcal/icalformat.cpp | |||
@@ -372,107 +372,109 @@ ScheduleMessage *ICalFormat::parseScheduleMessage( Calendar *cal, | |||
372 | break; | 372 | break; |
373 | case ICAL_METHOD_CANCEL: | 373 | case ICAL_METHOD_CANCEL: |
374 | method = Scheduler::Cancel; | 374 | method = Scheduler::Cancel; |
375 | break; | 375 | break; |
376 | case ICAL_METHOD_ADD: | 376 | case ICAL_METHOD_ADD: |
377 | method = Scheduler::Add; | 377 | method = Scheduler::Add; |
378 | break; | 378 | break; |
379 | case ICAL_METHOD_REPLY: | 379 | case ICAL_METHOD_REPLY: |
380 | method = Scheduler::Reply; | 380 | method = Scheduler::Reply; |
381 | break; | 381 | break; |
382 | case ICAL_METHOD_COUNTER: | 382 | case ICAL_METHOD_COUNTER: |
383 | method = Scheduler::Counter; | 383 | method = Scheduler::Counter; |
384 | break; | 384 | break; |
385 | case ICAL_METHOD_DECLINECOUNTER: | 385 | case ICAL_METHOD_DECLINECOUNTER: |
386 | method = Scheduler::Declinecounter; | 386 | method = Scheduler::Declinecounter; |
387 | break; | 387 | break; |
388 | default: | 388 | default: |
389 | method = Scheduler::NoMethod; | 389 | method = Scheduler::NoMethod; |
390 | kdDebug(5800) << "ICalFormat::parseScheduleMessage(): Unknow method" << endl; | 390 | kdDebug(5800) << "ICalFormat::parseScheduleMessage(): Unknow method" << endl; |
391 | break; | 391 | break; |
392 | } | 392 | } |
393 | 393 | ||
394 | 394 | ||
395 | if (!icalrestriction_check(message)) { | 395 | if (!icalrestriction_check(message)) { |
396 | setException(new ErrorFormat(ErrorFormat::Restriction, | 396 | setException(new ErrorFormat(ErrorFormat::Restriction, |
397 | Scheduler::translatedMethodName(method) + ": " + | 397 | Scheduler::translatedMethodName(method) + ": " + |
398 | mImpl->extractErrorProperty(c))); | 398 | mImpl->extractErrorProperty(c))); |
399 | return 0; | 399 | return 0; |
400 | } | 400 | } |
401 | 401 | ||
402 | icalcomponent *calendarComponent = mImpl->createCalendarComponent(cal); | 402 | icalcomponent *calendarComponent = mImpl->createCalendarComponent(cal); |
403 | 403 | ||
404 | Incidence *existingIncidence = cal->event(incidence->uid()); | 404 | Incidence *existingIncidence = cal->event(incidence->uid()); |
405 | if (existingIncidence) { | 405 | if (existingIncidence) { |
406 | // TODO: check, if cast is required, or if it can be done by virtual funcs. | 406 | // TODO: check, if cast is required, or if it can be done by virtual funcs. |
407 | if (existingIncidence->type() == "Todo") { | 407 | if (existingIncidence->type() == "Todo") { |
408 | Todo *todo = static_cast<Todo *>(existingIncidence); | 408 | Todo *todo = static_cast<Todo *>(existingIncidence); |
409 | icalcomponent_add_component(calendarComponent, | 409 | icalcomponent_add_component(calendarComponent, |
410 | mImpl->writeTodo(todo)); | 410 | mImpl->writeTodo(todo)); |
411 | } | 411 | } |
412 | if (existingIncidence->type() == "Event") { | 412 | if (existingIncidence->type() == "Event") { |
413 | Event *event = static_cast<Event *>(existingIncidence); | 413 | Event *event = static_cast<Event *>(existingIncidence); |
414 | icalcomponent_add_component(calendarComponent, | 414 | icalcomponent_add_component(calendarComponent, |
415 | mImpl->writeEvent(event)); | 415 | mImpl->writeEvent(event)); |
416 | } | 416 | } |
417 | } else { | 417 | } else { |
418 | calendarComponent = 0; | 418 | calendarComponent = 0; |
419 | } | 419 | } |
420 | 420 | qDebug("icalclassify commented out "); | |
421 | ScheduleMessage::Status status; | ||
422 | #if 0 | ||
421 | 423 | ||
422 | icalclass result = icalclassify(message,calendarComponent,(char *)""); | 424 | icalclass result = icalclassify(message,calendarComponent,(char *)""); |
423 | 425 | ||
424 | 426 | ||
425 | ScheduleMessage::Status status; | ||
426 | 427 | ||
427 | switch (result) { | 428 | switch (result) { |
428 | case ICAL_PUBLISH_NEW_CLASS: | 429 | case ICAL_PUBLISH_NEW_CLASS: |
429 | status = ScheduleMessage::PublishNew; | 430 | status = ScheduleMessage::PublishNew; |
430 | break; | 431 | break; |
431 | case ICAL_OBSOLETE_CLASS: | 432 | case ICAL_OBSOLETE_CLASS: |
432 | status = ScheduleMessage::Obsolete; | 433 | status = ScheduleMessage::Obsolete; |
433 | break; | 434 | break; |
434 | case ICAL_REQUEST_NEW_CLASS: | 435 | case ICAL_REQUEST_NEW_CLASS: |
435 | status = ScheduleMessage::RequestNew; | 436 | status = ScheduleMessage::RequestNew; |
436 | break; | 437 | break; |
437 | case ICAL_REQUEST_UPDATE_CLASS: | 438 | case ICAL_REQUEST_UPDATE_CLASS: |
438 | status = ScheduleMessage::RequestUpdate; | 439 | status = ScheduleMessage::RequestUpdate; |
439 | break; | 440 | break; |
440 | case ICAL_UNKNOWN_CLASS: | 441 | case ICAL_UNKNOWN_CLASS: |
441 | default: | 442 | default: |
442 | status = ScheduleMessage::Unknown; | 443 | status = ScheduleMessage::Unknown; |
443 | break; | 444 | break; |
444 | } | 445 | } |
445 | 446 | #endif | |
447 | status = ScheduleMessage::RequestUpdate; | ||
446 | return new ScheduleMessage(incidence,method,status); | 448 | return new ScheduleMessage(incidence,method,status); |
447 | } | 449 | } |
448 | 450 | ||
449 | void ICalFormat::setTimeZone( const QString &id, bool utc ) | 451 | void ICalFormat::setTimeZone( const QString &id, bool utc ) |
450 | { | 452 | { |
451 | 453 | ||
452 | 454 | ||
453 | mTimeZoneId = id; | 455 | mTimeZoneId = id; |
454 | mUtc = utc; | 456 | mUtc = utc; |
455 | 457 | ||
456 | tzOffsetMin = KGlobal::locale()->timezoneOffset(mTimeZoneId); | 458 | tzOffsetMin = KGlobal::locale()->timezoneOffset(mTimeZoneId); |
457 | 459 | ||
458 | //qDebug("ICalFormat::setTimeZoneOffset %s %d ",mTimeZoneId.latin1(), tzOffsetMin); | 460 | //qDebug("ICalFormat::setTimeZoneOffset %s %d ",mTimeZoneId.latin1(), tzOffsetMin); |
459 | } | 461 | } |
460 | 462 | ||
461 | QString ICalFormat::timeZoneId() const | 463 | QString ICalFormat::timeZoneId() const |
462 | { | 464 | { |
463 | return mTimeZoneId; | 465 | return mTimeZoneId; |
464 | } | 466 | } |
465 | 467 | ||
466 | bool ICalFormat::utc() const | 468 | bool ICalFormat::utc() const |
467 | { | 469 | { |
468 | return mUtc; | 470 | return mUtc; |
469 | } | 471 | } |
470 | int ICalFormat::timeOffset() | 472 | int ICalFormat::timeOffset() |
471 | { | 473 | { |
472 | return tzOffsetMin; | 474 | return tzOffsetMin; |
473 | } | 475 | } |
474 | const char *ICalFormat::tzString() | 476 | const char *ICalFormat::tzString() |
475 | { | 477 | { |
476 | const char* ret = (const char* ) mTzString; | 478 | const char* ret = (const char* ) mTzString; |
477 | return ret; | 479 | return ret; |
478 | } | 480 | } |