summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-29 21:26:43 (UTC)
committer zautrix <zautrix>2005-06-29 21:26:43 (UTC)
commit7ccfe9b674bd5cc52eab708c2e7dfb02c3328deb (patch) (unidiff)
tree4083b66180ee5385ee12dc2a9e03ef26e78f1f58
parentd1ca2fd41cb1390843c974c985cae5912d458d51 (diff)
downloadkdepimpi-7ccfe9b674bd5cc52eab708c2e7dfb02c3328deb.zip
kdepimpi-7ccfe9b674bd5cc52eab708c2e7dfb02c3328deb.tar.gz
kdepimpi-7ccfe9b674bd5cc52eab708c2e7dfb02c3328deb.tar.bz2
fixx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koimportoldialog.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/koimportoldialog.cpp b/korganizer/koimportoldialog.cpp
index c4d5f06..7aa6076 100644
--- a/korganizer/koimportoldialog.cpp
+++ b/korganizer/koimportoldialog.cpp
@@ -389,98 +389,98 @@ void KOImportOLdialog::ol2kopiCalendar( _AppointmentItem * aItem, bool computeRe
389 389
390 //GetOptionalAttendees() 390 //GetOptionalAttendees()
391 //GetRequiredAttendees() 391 //GetRequiredAttendees()
392 LPDISPATCH dispItem = aItem->GetRecipients(); 392 LPDISPATCH dispItem = aItem->GetRecipients();
393 dispItem->AddRef(); 393 dispItem->AddRef();
394 _Folders mf(dispItem); 394 _Folders mf(dispItem);
395 mf.m_lpDispatch->AddRef(); 395 mf.m_lpDispatch->AddRef();
396 _variant_t indx((long)0); 396 _variant_t indx((long)0);
397 LPDISPATCH itm; 397 LPDISPATCH itm;
398 int i; 398 int i;
399 QString optAtt = QString::fromUcs2( aItem->GetOptionalAttendees().GetBuffer()); 399 QString optAtt = QString::fromUcs2( aItem->GetOptionalAttendees().GetBuffer());
400 QString reqAtt = QString::fromUcs2( aItem->GetRequiredAttendees().GetBuffer()); 400 QString reqAtt = QString::fromUcs2( aItem->GetRequiredAttendees().GetBuffer());
401 //GetRequiredAttendees() 401 //GetRequiredAttendees()
402 for(i=1; i <= mf.GetCount(); ++i) { 402 for(i=1; i <= mf.GetCount(); ++i) {
403 indx = (long)i; 403 indx = (long)i;
404 itm = mf.Item( indx.Detach() ); 404 itm = mf.Item( indx.Detach() );
405 Recipient * pItem = (Recipient *)&itm; 405 Recipient * pItem = (Recipient *)&itm;
406 406
407 //a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 407 //a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
408 QString name = QString::fromUcs2( pItem->GetName().GetBuffer()); 408 QString name = QString::fromUcs2( pItem->GetName().GetBuffer());
409 KCal::Attendee::PartStat stat; 409 KCal::Attendee::PartStat stat;
410 bool rsvp = false; 410 bool rsvp = false;
411 switch ( pItem->GetMeetingResponseStatus() ) { 411 switch ( pItem->GetMeetingResponseStatus() ) {
412 case 0: //not answered 412 case 0: //not answered
413 rsvp = true; 413 rsvp = true;
414 case 5: //not answered 414 case 5: //not answered
415 stat = Attendee::NeedsAction; 415 stat = Attendee::NeedsAction;
416 break; 416 break;
417 case 1: //organizer 417 case 1: //organizer
418 stat = Attendee::Delegated ; 418 stat = Attendee::Delegated ;
419 break; 419 break;
420 case 2: //tentative 420 case 2: //tentative
421 stat = Attendee::Tentative ; 421 stat = Attendee::Tentative ;
422 break; 422 break;
423 case 3: //accepted 423 case 3: //accepted
424 stat = Attendee::Accepted; 424 stat = Attendee::Accepted;
425 break; 425 break;
426 case 4: //declined 426 case 4: //declined
427 stat =Attendee::Declined ; 427 stat =Attendee::Declined ;
428 break; 428 break;
429 default: 429 default:
430 stat = Attendee::NeedsAction ; 430 stat = Attendee::NeedsAction ;
431 431
432 } 432 }
433 KCal::Attendee::Role role; 433 KCal::Attendee::Role role;
434 if ( event->organizer() == name ) 434 if ( event->organizer() == name )
435 role = KCal::Attendee::Chair; 435 role = KCal::Attendee::Chair;
436 else if ( reqAtt.find( name ) >= 0 ) 436 else if ( reqAtt.find( name ) >= 0 )
437 role = KCal::Attendee::ReqParticipant; 437 role = KCal::Attendee::ReqParticipant;
438 else if ( optAtt.find( name ) >= 0 ) 438 else if ( optAtt.find( name ) >= 0 )
439 role = KCal::Attendee::OptParticipant; 439 role = KCal::Attendee::OptParticipant;
440 else 440 else
441 role = KCal::Attendee::NonParticipant; 441 role = KCal::Attendee::NonParticipant;
442 QString mail = QString::fromUcs2(pItem->GetAddress().GetBuffer()); 442 QString mail = QString::fromUcs2(pItem->GetAddress().GetBuffer());
443 if( mail.isEmpty() && name.find("@") > 0 ) { 443 if( mail.isEmpty() && name.find("@") > 0 ) {
444 int kl = name.find("<"); 444 int kl = name.find("<");
445 int gr = name.find(">"); 445 int gr = name.find(">");
446 if ( kl >= 0 && gr >= 0) { 446 if ( kl >= 0 && gr >= 0) {
447 mail = name.mid (kl+1, gr - kl -1); 447 mail = name.mid (kl+1, gr - kl -1);
448 name = name.left( kl ); 448 name = name.left( kl );
449 } 449 }
450 else 450 else
451 mail = name; 451 mail = name;
452 } 452 }
453 mail = mail.stripWhiteSpace(); 453 mail = mail.stripWhiteSpace();
454 454
455 QString uid = getUidByEmail( mail ); 455 QString uid = getUidByEmail( mail );
456 //uid = QString::fromUcs2( pItem->GetEntryID().GetBuffer()); 456 //uid = QString::fromUcs2( pItem->GetEntryID().GetBuffer());
457 KCal::Attendee * a = new KCal::Attendee( name, mail,rsvp,stat,role,uid) ; 457 KCal::Attendee * a = new KCal::Attendee( name, mail,rsvp,stat,role,uid) ;
458 event->addAttendee( a , false ); 458 event->addAttendee( a , false );
459 itm->Release(); 459 itm->Release();
460 } 460 }
461 461
462 462
463 if ( !mCalendar->addEventNoDup( event )) 463 if ( !mCalendar->addEventNoDup( event ))
464 delete event; 464 delete event;
465 else { 465 else {
466 // QString mes = i18n("Importing %1.\n date: %2 date: %3").arg( event->summary()).arg( event->dtStart().toString()).arg( event->dtEnd().toString()); 466 // QString mes = i18n("Importing %1.\n date: %2 date: %3").arg( event->summary()).arg( event->dtStart().toString()).arg( event->dtEnd().toString());
467 //KMessageBox::information(this,mes); 467 //KMessageBox::information(this,mes);
468 ++importedItems; 468 ++importedItems;
469 } 469 }
470} 470}
471void KOImportOLdialog::slotCancel() 471void KOImportOLdialog::slotCancel()
472{ 472{
473 reject(); 473 reject();
474} 474}
475 475
476QString KOImportOLdialog::getUidByEmail( QString email ) 476QString KOImportOLdialog::getUidByEmail( QString email )
477{ 477{
478 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); 478 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
479 KABC::AddressBook::Iterator it; 479 KABC::AddressBook::Iterator it;
480 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 480 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
481 QStringList em = (*it).emails(); 481 QStringList em = (*it).emails();
482 if ( em.contains( email )) 482 if ( em.contains( email ))
483 return (*it).uid(); 483 return (*it).uid();
484 } 484 }
485 return ""; 485 return email;
486} 486}