Diffstat (limited to 'kaddressbook/kaimportoldialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/kaimportoldialog.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/kaddressbook/kaimportoldialog.cpp b/kaddressbook/kaimportoldialog.cpp index 5e7d7c4..ef949e7 100644 --- a/kaddressbook/kaimportoldialog.cpp +++ b/kaddressbook/kaimportoldialog.cpp | |||
@@ -239,25 +239,25 @@ void KAImportOLdialog::readContactData( DWORD folder ) | |||
239 | } | 239 | } |
240 | } | 240 | } |
241 | void KAImportOLdialog::slotOk() | 241 | void KAImportOLdialog::slotOk() |
242 | { | 242 | { |
243 | QDialog::accept(); | 243 | QDialog::accept(); |
244 | } | 244 | } |
245 | 245 | ||
246 | void KAImportOLdialog::ol2kapiContact( _ContactItem * aItem ) | 246 | void KAImportOLdialog::ol2kapiContact( _ContactItem * aItem ) |
247 | { | 247 | { |
248 | KABC::Addressee addressee; | 248 | KABC::Addressee addressee; |
249 | 249 | ||
250 | addressee.setUid( QString::fromUcs2(aItem->GetEntryID().GetBuffer())); | 250 | addressee.setUid( QString::fromUcs2(aItem->GetEntryID().GetBuffer())); |
251 | 251 | //GetLastModificationTime() | |
252 | //addressee.setName( const QString &name ); | 252 | //addressee.setName( const QString &name ); |
253 | //addressee.setFormattedName( const QString &formattedName ); | 253 | //addressee.setFormattedName( const QString &formattedName ); |
254 | addressee.setFamilyName( QString::fromUcs2(aItem->GetLastName().GetBuffer()) ); | 254 | addressee.setFamilyName( QString::fromUcs2(aItem->GetLastName().GetBuffer()) ); |
255 | addressee.setGivenName( QString::fromUcs2(aItem->GetFirstName().GetBuffer()) ); | 255 | addressee.setGivenName( QString::fromUcs2(aItem->GetFirstName().GetBuffer()) ); |
256 | addressee.setAdditionalName( QString::fromUcs2(aItem->GetMiddleName().GetBuffer()) ); | 256 | addressee.setAdditionalName( QString::fromUcs2(aItem->GetMiddleName().GetBuffer()) ); |
257 | addressee.setPrefix(QString::fromUcs2(aItem->GetTitle().GetBuffer()) ); | 257 | addressee.setPrefix(QString::fromUcs2(aItem->GetTitle().GetBuffer()) ); |
258 | addressee.setSuffix( QString::fromUcs2(aItem->GetSuffix().GetBuffer()) ); | 258 | addressee.setSuffix( QString::fromUcs2(aItem->GetSuffix().GetBuffer()) ); |
259 | addressee.setNickName( QString::fromUcs2(aItem->GetNickName().GetBuffer()) ); | 259 | addressee.setNickName( QString::fromUcs2(aItem->GetNickName().GetBuffer()) ); |
260 | QDateTime dtb = mDdate2Qdtr(aItem->GetBirthday()); | 260 | QDateTime dtb = mDdate2Qdtr(aItem->GetBirthday()); |
261 | if ( dtb.isValid() ) | 261 | if ( dtb.isValid() ) |
262 | addressee.setBirthday( mDdate2Qdtr(aItem->GetBirthday())); | 262 | addressee.setBirthday( mDdate2Qdtr(aItem->GetBirthday())); |
263 | 263 | ||
@@ -620,16 +620,20 @@ void KAImportOLdialog::slotCancel() | |||
620 | } | 620 | } |
621 | 621 | ||
622 | bool KAImportOLdialog::addAddressee( KABC::Addressee a ) | 622 | bool KAImportOLdialog::addAddressee( KABC::Addressee a ) |
623 | { | 623 | { |
624 | bool add = true; | 624 | bool add = true; |
625 | KABC::Addressee::List::Iterator it; | 625 | KABC::Addressee::List::Iterator it; |
626 | for ( it = mAList.begin(); it != mAList.end(); ++it ) { | 626 | for ( it = mAList.begin(); it != mAList.end(); ++it ) { |
627 | if ( (*it).uid() == a.uid() ) { | 627 | if ( (*it).uid() == a.uid() ) { |
628 | add = false; | 628 | add = false; |
629 | break; | 629 | break; |
630 | } | 630 | } |
631 | } | 631 | } |
632 | if ( add ) | 632 | if ( add ) { |
633 | mAList.append ( a ); | 633 | if ( mABook->findByUid(a.uid() ).isEmpty()) |
634 | mAList.append ( a ); | ||
635 | else | ||
636 | add = false; | ||
637 | } | ||
634 | return add; | 638 | return add; |
635 | } | 639 | } |