author | zautrix <zautrix> | 2004-09-15 15:08:01 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-15 15:08:01 (UTC) |
commit | 93d16eea6d3324611d6150e7ee3e7f7f36320eff (patch) (unidiff) | |
tree | f0437e15f455ddfe1bd4ed8908fdaee67c26d38c | |
parent | d37aeeb9aa023d52b364c971fa4aabd0c8f339b9 (diff) | |
download | kdepimpi-93d16eea6d3324611d6150e7ee3e7f7f36320eff.zip kdepimpi-93d16eea6d3324611d6150e7ee3e7f7f36320eff.tar.gz kdepimpi-93d16eea6d3324611d6150e7ee3e7f7f36320eff.tar.bz2 |
KOPi OLE import changes
-rw-r--r-- | korganizer/koimportoldialog.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/korganizer/koimportoldialog.cpp b/korganizer/koimportoldialog.cpp index 16f2eca..0a3c2d5 100644 --- a/korganizer/koimportoldialog.cpp +++ b/korganizer/koimportoldialog.cpp | |||
@@ -410,66 +410,74 @@ void KOImportOLdialog::ol2kopiCalendar( _AppointmentItem * aItem, bool computeRe | |||
410 | switch ( pItem->GetMeetingResponseStatus() ) { | 410 | switch ( pItem->GetMeetingResponseStatus() ) { |
411 | case 0: //not answered | 411 | case 0: //not answered |
412 | rsvp = true; | 412 | rsvp = true; |
413 | case 5: //not answered | 413 | case 5: //not answered |
414 | stat = Attendee::NeedsAction; | 414 | stat = Attendee::NeedsAction; |
415 | break; | 415 | break; |
416 | case 1: //organizer | 416 | case 1: //organizer |
417 | stat = Attendee::Delegated ; | 417 | stat = Attendee::Delegated ; |
418 | break; | 418 | break; |
419 | case 2: //tentative | 419 | case 2: //tentative |
420 | stat = Attendee::Tentative ; | 420 | stat = Attendee::Tentative ; |
421 | break; | 421 | break; |
422 | case 3: //accepted | 422 | case 3: //accepted |
423 | stat = Attendee::Accepted; | 423 | stat = Attendee::Accepted; |
424 | break; | 424 | break; |
425 | case 4: //declined | 425 | case 4: //declined |
426 | stat =Attendee::Declined ; | 426 | stat =Attendee::Declined ; |
427 | break; | 427 | break; |
428 | default: | 428 | default: |
429 | stat = Attendee::NeedsAction ; | 429 | stat = Attendee::NeedsAction ; |
430 | 430 | ||
431 | } | 431 | } |
432 | KCal::Attendee::Role role; | 432 | KCal::Attendee::Role role; |
433 | if ( event->organizer() == name ) | 433 | if ( event->organizer() == name ) |
434 | role = KCal::Attendee::Chair; | 434 | role = KCal::Attendee::Chair; |
435 | else if ( reqAtt.find( name ) >= 0 ) | 435 | else if ( reqAtt.find( name ) >= 0 ) |
436 | role = KCal::Attendee::ReqParticipant; | 436 | role = KCal::Attendee::ReqParticipant; |
437 | else if ( optAtt.find( name ) >= 0 ) | 437 | else if ( optAtt.find( name ) >= 0 ) |
438 | role = KCal::Attendee::OptParticipant; | 438 | role = KCal::Attendee::OptParticipant; |
439 | else | 439 | else |
440 | role = KCal::Attendee::NonParticipant; | 440 | role = KCal::Attendee::NonParticipant; |
441 | QString mail = QString::fromUcs2(pItem->GetAddress().GetBuffer()); | 441 | QString mail = QString::fromUcs2(pItem->GetAddress().GetBuffer()); |
442 | if( mail.isEmpty() && name.find("@") > 0 ) | 442 | if( mail.isEmpty() && name.find("@") > 0 ) { |
443 | mail = name; | 443 | int kl = name.find("<"); |
444 | int gr = name.find(">"); | ||
445 | if ( kl >= 0 && gr >= 0) { | ||
446 | mail = name.mid (kl+1, gr - kl -1); | ||
447 | name = name.left( kl ); | ||
448 | } | ||
449 | else | ||
450 | mail = name; | ||
451 | } | ||
444 | mail = mail.stripWhiteSpace(); | 452 | mail = mail.stripWhiteSpace(); |
445 | 453 | ||
446 | QString uid = getUidByEmail( mail ); | 454 | QString uid = getUidByEmail( mail ); |
447 | //uid = QString::fromUcs2( pItem->GetEntryID().GetBuffer()); | 455 | //uid = QString::fromUcs2( pItem->GetEntryID().GetBuffer()); |
448 | KCal::Attendee * a = new KCal::Attendee( name, mail,rsvp,stat,role,uid) ; | 456 | KCal::Attendee * a = new KCal::Attendee( name, mail,rsvp,stat,role,uid) ; |
449 | event->addAttendee( a , false ); | 457 | event->addAttendee( a , false ); |
450 | itm->Release(); | 458 | itm->Release(); |
451 | } | 459 | } |
452 | 460 | ||
453 | 461 | ||
454 | if ( !mCalendar->addEventNoDup( event )) | 462 | if ( !mCalendar->addEventNoDup( event )) |
455 | delete event; | 463 | delete event; |
456 | else { | 464 | else { |
457 | // QString mes = i18n("Importing %1.\n date: %2 date: %3").arg( event->summary()).arg( event->dtStart().toString()).arg( event->dtEnd().toString()); | 465 | // QString mes = i18n("Importing %1.\n date: %2 date: %3").arg( event->summary()).arg( event->dtStart().toString()).arg( event->dtEnd().toString()); |
458 | //KMessageBox::information(this,mes); | 466 | //KMessageBox::information(this,mes); |
459 | ++importedItems; | 467 | ++importedItems; |
460 | } | 468 | } |
461 | } | 469 | } |
462 | void KOImportOLdialog::slotCancel() | 470 | void KOImportOLdialog::slotCancel() |
463 | { | 471 | { |
464 | reject(); | 472 | reject(); |
465 | } | 473 | } |
466 | 474 | ||
467 | QString KOImportOLdialog::getUidByEmail( QString email ) | 475 | QString KOImportOLdialog::getUidByEmail( QString email ) |
468 | { | 476 | { |
469 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); | 477 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); |
470 | KABC::AddressBook::Iterator it; | 478 | KABC::AddressBook::Iterator it; |
471 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { | 479 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { |
472 | QStringList em = (*it).emails(); | 480 | QStringList em = (*it).emails(); |
473 | if ( em.contains( email )) | 481 | if ( em.contains( email )) |
474 | return (*it).uid(); | 482 | return (*it).uid(); |
475 | } | 483 | } |