summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koimportoldialog.cpp21
-rw-r--r--korganizer/koimportoldialog.h1
2 files changed, 17 insertions, 5 deletions
diff --git a/korganizer/koimportoldialog.cpp b/korganizer/koimportoldialog.cpp
index 36363e5..16f2eca 100644
--- a/korganizer/koimportoldialog.cpp
+++ b/korganizer/koimportoldialog.cpp
@@ -47,4 +47,5 @@
47#include <libkcal/calendarlocal.h> 47#include <libkcal/calendarlocal.h>
48#include <libkcal/icalformat.h> 48#include <libkcal/icalformat.h>
49#include <kabc/stdaddressbook.h>
49 50
50#include "koprefs.h" 51#include "koprefs.h"
@@ -441,10 +442,8 @@ void KOImportOLdialog::ol2kopiCalendar( _AppointmentItem * aItem, bool computeRe
441 if( mail.isEmpty() && name.find("@") > 0 ) 442 if( mail.isEmpty() && name.find("@") > 0 )
442 mail = name; 443 mail = name;
443 QString uid;
444 if ( mail.isEmpty() )
445 uid = QString::fromUcs2( pItem->GetEntryID().GetBuffer());
446 else
447 uid = mail;
448 mail = mail.stripWhiteSpace(); 444 mail = mail.stripWhiteSpace();
445
446 QString uid = getUidByEmail( mail );
447 //uid = QString::fromUcs2( pItem->GetEntryID().GetBuffer());
449 KCal::Attendee * a = new KCal::Attendee( name, mail,rsvp,stat,role,uid) ; 448 KCal::Attendee * a = new KCal::Attendee( name, mail,rsvp,stat,role,uid) ;
450 event->addAttendee( a , false ); 449 event->addAttendee( a , false );
@@ -465,2 +464,14 @@ void KOImportOLdialog::slotCancel()
465 reject(); 464 reject();
466} 465}
466
467QString KOImportOLdialog::getUidByEmail( QString email )
468{
469 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
470 KABC::AddressBook::Iterator it;
471 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
472 QStringList em = (*it).emails();
473 if ( em.contains( email ))
474 return (*it).uid();
475 }
476 return "";
477}
diff --git a/korganizer/koimportoldialog.h b/korganizer/koimportoldialog.h
index f6a753d..c8847c5 100644
--- a/korganizer/koimportoldialog.h
+++ b/korganizer/koimportoldialog.h
@@ -74,4 +74,5 @@ class KOImportOLdialog : public KDialogBase
74 Calendar *mCalendar; 74 Calendar *mCalendar;
75 QListView * mListView; 75 QListView * mListView;
76 QString getUidByEmail( QString email );
76 77
77 private: 78 private: