author | zautrix <zautrix> | 2004-09-15 15:06:44 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-15 15:06:44 (UTC) |
commit | d37aeeb9aa023d52b364c971fa4aabd0c8f339b9 (patch) (side-by-side diff) | |
tree | 6d818d2c6dae0921b793f09e2ed569cbe7dd7d09 | |
parent | 12091abdaa7e60e408fc248e286f37e12cb10a23 (diff) | |
download | kdepimpi-d37aeeb9aa023d52b364c971fa4aabd0c8f339b9.zip kdepimpi-d37aeeb9aa023d52b364c971fa4aabd0c8f339b9.tar.gz kdepimpi-d37aeeb9aa023d52b364c971fa4aabd0c8f339b9.tar.bz2 |
KAPi OLE import changes
-rw-r--r-- | kaddressbook/kabcore.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/kaimportoldialog.cpp | 60 |
2 files changed, 59 insertions, 3 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 013e243..f21507a 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -1618,193 +1618,193 @@ void KABCore::initActions() SLOT( copyContacts() ), actionCollection(), "kaddressbook_copy" ); mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, SLOT( cutContacts() ), actionCollection(), "kaddressbook_cut" ); mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, SLOT( pasteContacts() ), actionCollection(), "kaddressbook_paste" ); mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, SLOT( selectAllContacts() ), actionCollection(), "kaddressbook_select_all" ); mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, SLOT( undo() ), actionCollection(), "kaddressbook_undo" ); mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, this, SLOT( redo() ), actionCollection(), "kaddressbook_redo" ); } else { mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); } mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", Key_Delete, this, SLOT( deleteContacts() ), actionCollection(), "edit_delete" ); mActionUndo->setEnabled( false ); mActionRedo->setEnabled( false ); // settings menu #ifdef KAB_EMBEDDED //US special menuentry to configure the addressbook resources. On KDE // you do that through the control center !!! mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, SLOT( configureResources() ), actionCollection(), "kaddressbook_configure_resources" ); #endif //KAB_EMBEDDED if ( mIsPart ) { mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, SLOT( openConfigDialog() ), actionCollection(), "kaddressbook_configure" ); mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, this, SLOT( configureKeyBindings() ), actionCollection(), "kaddressbook_configure_shortcuts" ); #ifdef KAB_EMBEDDED mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); mActionConfigureToolbars->setEnabled( false ); #endif //KAB_EMBEDDED } else { mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); } mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, actionCollection(), "options_show_jump_bar" ); connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, actionCollection(), "options_show_details" ); connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); // misc // only enable LDAP lookup if we can handle the protocol #ifndef KAB_EMBEDDED if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, this, SLOT( openLDAPDialog() ), actionCollection(), "ldap_lookup" ); } #else //KAB_EMBEDDED //qDebug("KABCore::initActions() LDAP has to be implemented"); #endif //KAB_EMBEDDED mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, SLOT( setWhoAmI() ), actionCollection(), "set_personal" ); mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, SLOT( setCategories() ), actionCollection(), "edit_set_categories" ); mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, SLOT( removeVoice() ), actionCollection(), "remove_voice" ); - mActionImportOL = new KAction( i18n( "Import from OL..." ), 0, this, + mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, SLOT( importFromOL() ), actionCollection(), "import_OL" ); #ifdef KAB_EMBEDDED mActionLicence = new KAction( i18n( "Licence" ), 0, this, SLOT( showLicence() ), actionCollection(), "licence_about_data" ); mActionFaq = new KAction( i18n( "Faq" ), 0, this, SLOT( faq() ), actionCollection(), "faq_about_data" ); mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, this, SLOT( createAboutData() ), actionCollection(), "kaddressbook_about_data" ); #endif //KAB_EMBEDDED clipboardDataChanged(); connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); } //US we need this function, to plug all actions into the correct menues. // KDE uses a XML format to plug the actions, but we work her without this overhead. void KABCore::addActionsManually() { //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); #ifdef KAB_EMBEDDED QPopupMenu *fileMenu = new QPopupMenu( this ); QPopupMenu *editMenu = new QPopupMenu( this ); QPopupMenu *helpMenu = new QPopupMenu( this ); KToolBar* tb = mMainWindow->toolBar(); #ifdef DESKTOP_VERSION QMenuBar* mb = mMainWindow->menuBar(); //US setup menubar. //Disable the following block if you do not want to have a menubar. mb->insertItem( "&File", fileMenu ); mb->insertItem( "&Edit", editMenu ); mb->insertItem( "&View", viewMenu ); mb->insertItem( "&Settings", settingsMenu ); mb->insertItem( "&Change selected", changeMenu ); mb->insertItem( "&Help", helpMenu ); mIncSearchWidget = new IncSearchWidget( tb ); // tb->insertWidget(-1, 0, mIncSearchWidget); #else //US setup toolbar QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); QPopupMenu *popupBarTB = new QPopupMenu( this ); menuBarTB->insertItem( "ME", popupBarTB); tb->insertWidget(-1, 0, menuBarTB); mIncSearchWidget = new IncSearchWidget( tb ); tb->enableMoving(false); popupBarTB->insertItem( "&File", fileMenu ); popupBarTB->insertItem( "&Edit", editMenu ); popupBarTB->insertItem( "&View", viewMenu ); popupBarTB->insertItem( "&Settings", settingsMenu ); mViewManager->getFilterAction()->plug ( popupBarTB); popupBarTB->insertItem( "&Change selected", changeMenu ); popupBarTB->insertItem( "&Help", helpMenu ); if (QApplication::desktop()->width() > 320 ) { // mViewManager->getFilterAction()->plug ( tb); } #endif // mActionQuit->plug ( mMainWindow->toolBar()); //US Now connect the actions with the menue entries. mActionPrint->plug( fileMenu ); mActionMail->plug( fileMenu ); fileMenu->insertSeparator(); mActionNewContact->plug( fileMenu ); mActionNewContact->plug( tb ); mActionEditAddressee->plug( fileMenu ); if ((KGlobal::getDesktopSize() > KGlobal::Small ) || (!KABPrefs::instance()->mMultipleViewsAtOnce )) mActionEditAddressee->plug( tb ); fileMenu->insertSeparator(); mActionSave->plug( fileMenu ); fileMenu->insertItem( "&Import", ImportMenu ); fileMenu->insertItem( "&Export", ExportMenu ); fileMenu->insertSeparator(); mActionMailVCard->plug( fileMenu ); #ifndef DESKTOP_VERSION if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); if ( Ir::supported() ) mActionBeam->plug(fileMenu ); #endif fileMenu->insertSeparator(); mActionQuit->plug( fileMenu ); diff --git a/kaddressbook/kaimportoldialog.cpp b/kaddressbook/kaimportoldialog.cpp index ef949e7..10e3c76 100644 --- a/kaddressbook/kaimportoldialog.cpp +++ b/kaddressbook/kaimportoldialog.cpp @@ -175,193 +175,193 @@ void KAImportOLdialog::addFolder(OLEListViewItem* iParent, LPDISPATCH dispParent ts = i18n("Contacts"); break; case 3: ts = i18n("Todos"); break; case 4: ts = i18n("Journals"); break; case 5: ts = i18n("Notes"); break; default: ts = i18n("Unknown"); } hChild->setText( 1,ts); hChild->setData( (DWORD) mfChild.m_lpDispatch ); mfChild.m_lpDispatch->AddRef(); addFolder(hChild, mfChild.m_lpDispatch); } } void KAImportOLdialog::slotApply() { importedItems = 0; OLEListViewItem* child = (OLEListViewItem*) mListView->firstChild(); while ( child ) { if ( child->isOn() ) readContactData( child->data() ); child = (OLEListViewItem*) child->itemBelow(); } QString mes = i18n("Importing complete.\n\n%1 items imported.").arg( importedItems); KMessageBox::information(this,mes); } void KAImportOLdialog::readContactData( DWORD folder ) { LPDISPATCH dispItem = (LPDISPATCH)folder; dispItem->AddRef(); MAPIFolder mf(dispItem); mf.m_lpDispatch->AddRef(); _Items folderItems; _variant_t indx((long)0); LPDISPATCH itm; int i; folderItems = mf.GetItems(); QProgressBar bar( folderItems.GetCount(),0 ); bar.setCaption (i18n("Importing - close to abort!") ); int h = bar.sizeHint().height() ; int w = 300; int dw = QApplication::desktop()->width(); int dh = QApplication::desktop()->height(); bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); bar.show(); for(i=1; i <= folderItems.GetCount(); ++i) { qApp->processEvents(); if ( ! bar.isVisible() ) return ; bar.setProgress( i ); indx = (long)i; itm = folderItems.Item(indx.Detach()); _ContactItem * pItem = (_ContactItem *)&itm; ol2kapiContact( pItem ); itm->Release(); } } void KAImportOLdialog::slotOk() { QDialog::accept(); } void KAImportOLdialog::ol2kapiContact( _ContactItem * aItem ) { KABC::Addressee addressee; addressee.setUid( QString::fromUcs2(aItem->GetEntryID().GetBuffer())); //GetLastModificationTime() //addressee.setName( const QString &name ); //addressee.setFormattedName( const QString &formattedName ); addressee.setFamilyName( QString::fromUcs2(aItem->GetLastName().GetBuffer()) ); addressee.setGivenName( QString::fromUcs2(aItem->GetFirstName().GetBuffer()) ); addressee.setAdditionalName( QString::fromUcs2(aItem->GetMiddleName().GetBuffer()) ); addressee.setPrefix(QString::fromUcs2(aItem->GetTitle().GetBuffer()) ); addressee.setSuffix( QString::fromUcs2(aItem->GetSuffix().GetBuffer()) ); addressee.setNickName( QString::fromUcs2(aItem->GetNickName().GetBuffer()) ); QDateTime dtb = mDdate2Qdtr(aItem->GetBirthday()); if ( dtb.isValid() ) addressee.setBirthday( mDdate2Qdtr(aItem->GetBirthday())); //QString::fromUcs2(aItem->.GetBuffer()) //addressee.setMailer( const QString &mailer ); //addressee.setTimeZone( const TimeZone &timeZone ); //addressee.setGeo( const Geo &geo ); //addressee.setTitle( QString::fromUcs2(aItem->GetJobTitle().GetBuffer()) );// titel is the prefix addressee.setRole( QString::fromUcs2(aItem->GetJobTitle().GetBuffer()) ); addressee.setOrganization( QString::fromUcs2(aItem->GetCompanyName().GetBuffer()) ); - addressee.setNote( QString::fromUcs2(aItem->GetBody().GetBuffer()) ); + QString notesStr = QString::fromUcs2(aItem->GetBody().GetBuffer()); addressee.setProductId( QString::fromUcs2(aItem->GetCustomerID().GetBuffer()) ); //addressee.setRevision( const QDateTime &revision ); // addressee.setSortString( const QString &sortString ); addressee.setUrl( QString::fromUcs2(aItem->GetWebPage().GetBuffer()) ); QString tempS; tempS = QString::fromUcs2(aItem->GetNetMeetingAlias().GetBuffer())+" AT SERVER: " +QString::fromUcs2(aItem->GetNetMeetingServer().GetBuffer()); if ( tempS.length() > 12 ) addressee.insertCustom( "KADDRESSBOOK", "X-IMAddress", tempS ); tempS = QString::fromUcs2(aItem->GetSpouse().GetBuffer()); if ( !tempS.isEmpty() ) addressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", tempS ); tempS = QString::fromUcs2(aItem->GetManagerName().GetBuffer()); if ( !tempS.isEmpty() ) addressee.insertCustom( "KADDRESSBOOK", "X-ManagersName", tempS ); tempS = QString::fromUcs2(aItem->GetAssistantName().GetBuffer()); if ( !tempS.isEmpty() ) addressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName", tempS ); tempS = QString::fromUcs2(aItem->GetDepartment().GetBuffer()); if ( !tempS.isEmpty() ) addressee.insertCustom( "KADDRESSBOOK", "X-Department", tempS ); tempS = QString::fromUcs2(aItem->GetOfficeLocation().GetBuffer()); if ( !tempS.isEmpty() ) addressee.insertCustom( "KADDRESSBOOK", "X-Office",tempS ); tempS = QString::fromUcs2(aItem->GetProfession().GetBuffer()); if ( !tempS.isEmpty() ) addressee.insertCustom( "KADDRESSBOOK", "X-Profession", tempS ); dtb = mDdate2Qdtr(aItem->GetAnniversary()); if (dtb.isValid() ) { QString dt = KGlobal::locale()->formatDate( dtb.date() , true, KLocale::ISODate); addressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt); } int sec = aItem->GetSensitivity() ; if ( sec > 1 )// mapping pers -> private --sec; addressee.setSecrecy( sec ); //addressee.setLogo( const Picture &logo ); //addressee.setPhoto( const Picture &photo ); //addressee.setSound( const Sound &sound ); //addressee.setAgent( const Agent &agent ); QString cat = QString::fromUcs2( aItem->GetCategories().GetBuffer()); addressee.setCategories( QStringList::split( ";", cat )); QString phoneS; phoneS = QString::fromUcs2( aItem->GetAssistantTelephoneNumber().GetBuffer()); if ( ! phoneS.isEmpty()) addressee.insertPhoneNumber( KABC::PhoneNumber(phoneS ,KABC::PhoneNumber::Work + KABC::PhoneNumber::Voice ) ); phoneS = QString::fromUcs2( aItem->GetBusinessTelephoneNumber().GetBuffer()); if ( ! phoneS.isEmpty()) addressee.insertPhoneNumber( KABC::PhoneNumber(phoneS ,KABC::PhoneNumber::Work ) ); phoneS = QString::fromUcs2( aItem->GetBusiness2TelephoneNumber().GetBuffer()); if ( ! phoneS.isEmpty()) addressee.insertPhoneNumber( KABC::PhoneNumber(phoneS ,KABC::PhoneNumber::Work ) ); phoneS = QString::fromUcs2( aItem->GetBusinessFaxNumber().GetBuffer()); if ( ! phoneS.isEmpty()) addressee.insertPhoneNumber( KABC::PhoneNumber(phoneS ,KABC::PhoneNumber::Work + KABC::PhoneNumber::Fax ) ); phoneS = QString::fromUcs2( aItem->GetCarTelephoneNumber().GetBuffer()); if ( ! phoneS.isEmpty()) addressee.insertPhoneNumber( KABC::PhoneNumber(phoneS ,KABC::PhoneNumber::Car ) ); phoneS = QString::fromUcs2( aItem->GetHomeTelephoneNumber().GetBuffer()); if ( ! phoneS.isEmpty()) addressee.insertPhoneNumber( KABC::PhoneNumber(phoneS ,KABC::PhoneNumber::Home ) ); phoneS = QString::fromUcs2( aItem->GetHome2TelephoneNumber().GetBuffer()); if ( ! phoneS.isEmpty()) addressee.insertPhoneNumber( KABC::PhoneNumber(phoneS ,KABC::PhoneNumber::Home ) ); phoneS = QString::fromUcs2( aItem->GetHomeFaxNumber().GetBuffer()); if ( ! phoneS.isEmpty()) addressee.insertPhoneNumber( KABC::PhoneNumber(phoneS ,KABC::PhoneNumber::Home + KABC::PhoneNumber::Fax ) ); phoneS = QString::fromUcs2( aItem->GetISDNNumber().GetBuffer()); if ( ! phoneS.isEmpty()) addressee.insertPhoneNumber( KABC::PhoneNumber(phoneS ,KABC::PhoneNumber::Isdn ) ); phoneS = QString::fromUcs2( aItem->GetMobileTelephoneNumber().GetBuffer()); if ( ! phoneS.isEmpty()) addressee.insertPhoneNumber( KABC::PhoneNumber(phoneS ,KABC::PhoneNumber::Cell ) ); phoneS = QString::fromUcs2( aItem->GetOtherFaxNumber().GetBuffer()); if ( ! phoneS.isEmpty()) addressee.insertPhoneNumber( KABC::PhoneNumber(phoneS ,KABC::PhoneNumber::Fax ) ); phoneS = QString::fromUcs2( aItem->GetOtherTelephoneNumber().GetBuffer()); if ( ! phoneS.isEmpty()) addressee.insertPhoneNumber( KABC::PhoneNumber(phoneS ,KABC::PhoneNumber::Voice ) ); phoneS = QString::fromUcs2( aItem->GetPagerNumber().GetBuffer()); if ( ! phoneS.isEmpty()) addressee.insertPhoneNumber( KABC::PhoneNumber(phoneS ,KABC::PhoneNumber::Pager ) ); phoneS = QString::fromUcs2( aItem->GetPrimaryTelephoneNumber().GetBuffer()); if ( ! phoneS.isEmpty()) addressee.insertPhoneNumber( KABC::PhoneNumber(phoneS ,KABC::PhoneNumber::Pref ) ); phoneS = QString::fromUcs2( aItem->GetTTYTDDTelephoneNumber().GetBuffer()); if ( ! phoneS.isEmpty()) addressee.insertPhoneNumber( KABC::PhoneNumber(phoneS ,KABC::PhoneNumber::Modem ) ); phoneS = QString::fromUcs2( aItem->GetTelexNumber().GetBuffer()); if ( ! phoneS.isEmpty()) addressee.insertPhoneNumber( KABC::PhoneNumber(phoneS ,KABC::PhoneNumber::Fax + KABC::PhoneNumber::Bbs ) ); phoneS = QString::fromUcs2( aItem->GetCompanyMainTelephoneNumber().GetBuffer()); if ( ! phoneS.isEmpty()) @@ -510,130 +510,186 @@ void KAImportOLdialog::ol2kapiContact( _ContactItem * aItem ) if ( ! phoneS.isEmpty()) { addressAdd->setStreet(phoneS ); insert = true; } phoneS = QString::fromUcs2( aItem->GetOtherAddress().GetBuffer()); if ( ! phoneS.isEmpty()) { // redundant !addressAdd->setExtended(phoneS ); //insert = true; } //addressAdd->setId( ); if ( insert ) addressee.insertAddress( *addressAdd ); // ++++++++++++++++++++++ end of address KABC::Address addressMail; addressAdd = &addressMail; insert = false; phoneS = QString::fromUcs2( aItem->GetMailingAddressCountry().GetBuffer()); if ( ! phoneS.isEmpty()) { addressAdd->setCountry(phoneS ); insert = true; } phoneS = QString::fromUcs2( aItem->GetMailingAddressState().GetBuffer()); if ( ! phoneS.isEmpty()) { addressAdd->setRegion(phoneS ); insert = true; } phoneS = QString::fromUcs2( aItem->GetMailingAddressCity().GetBuffer()); if ( ! phoneS.isEmpty()) { addressAdd->setLocality(phoneS ); insert = true; } phoneS = QString::fromUcs2( aItem->GetMailingAddressPostalCode().GetBuffer()); if ( ! phoneS.isEmpty()) { addressAdd->setPostalCode(phoneS ); insert = true; } phoneS = QString::fromUcs2( aItem->GetMailingAddressPostOfficeBox().GetBuffer()); if ( ! phoneS.isEmpty()) { addressAdd->setPostOfficeBox(phoneS ); insert = true; } phoneS = QString::fromUcs2( aItem->GetMailingAddressStreet().GetBuffer()); if ( ! phoneS.isEmpty()) { addressAdd->setStreet(phoneS ); insert = true; } phoneS = QString::fromUcs2( aItem->GetMailingAddress().GetBuffer()); if ( ! phoneS.isEmpty()) { // redundant ! addressAdd->setExtended(phoneS ); // insert = true; } addressAdd->setType( KABC::Address::Postal ); if ( insert ) { addressee.insertAddress( *addressAdd ); } // the following code is disabled // it does not seem to be useful #if 0 if ( insert ) { addressAdd->setType( KABC::Address::Home ); if ( addressMail == addressHome ) { addressHome.setType( KABC::Address::Postal+ KABC::Address::Home ); addressee.insertAddress( addressHome ); } else { addressAdd->setType( KABC::Address::Work ); if ( addressMail == addressWork ){ addressWork.setType( KABC::Address::Postal+ KABC::Address::Work ); addressee.insertAddress( addressWork ); } else { addressAdd->setType( 0 ); if ( addressOther == addressMail ){ addressOther.setType( KABC::Address::Postal ); addressee.insertAddress( addressOther ); } else { addressee.insertAddress( *addressAdd ); } } } } #endif // ++++++++++++++++++++++ end of ALL addresses //GetUserProperties(); tempS = QString::fromUcs2(aItem->GetInternetFreeBusyAddress().GetBuffer()); if ( !tempS.isEmpty() ) addressee.insertCustom( "KADDRESSBOOK", "X-FreeBusyUrl", tempS ); tempS = QString::fromUcs2(aItem->GetChildren().GetBuffer()); if ( !tempS.isEmpty() ) addressee.insertCustom( "KADDRESSBOOK", "X-Children", tempS ); int gen = aItem->GetGender(); if ( gen != 0 ) { // 0 undef - 1 female - 2 male if ( gen == 1 ) addressee.insertCustom( "KADDRESSBOOK", "X-Gender", "female" ); else addressee.insertCustom( "KADDRESSBOOK", "X-Gender", "male" ); } - + QString additionalInfo; + QString tempAdd; + tempAdd = QString::fromUcs2(aItem->GetLanguage().GetBuffer()); + if ( ! tempAdd.isEmpty() ) { + additionalInfo += i18n("\nLanguage: "); + additionalInfo += tempAdd; + } + tempAdd = QString::fromUcs2(aItem->GetHobby().GetBuffer()); + if ( ! tempAdd.isEmpty() ) { + additionalInfo += i18n("\nHobby: "); + additionalInfo += tempAdd;; + } + tempAdd =QString::fromUcs2(aItem->GetPersonalHomePage().GetBuffer()); + if ( ! tempAdd.isEmpty() ) { + additionalInfo += i18n("\nHomepage: "); + additionalInfo += tempAdd;; + } + tempAdd = QString::fromUcs2(aItem->GetBillingInformation().GetBuffer()); + if ( ! tempAdd.isEmpty() ) { + additionalInfo += i18n("\nBilling information: "); + additionalInfo += tempAdd;; + } + tempAdd = QString::fromUcs2(aItem->GetCustomerID().GetBuffer()); + if ( ! tempAdd.isEmpty() ) { + additionalInfo += i18n("\nCustomer ID: "); + additionalInfo += tempAdd;; + } + tempAdd = QString::fromUcs2(aItem->GetUser1().GetBuffer()); + if ( ! tempAdd.isEmpty() ) { + additionalInfo += i18n("\nUser1: "); + additionalInfo += tempAdd;; + } + tempAdd = QString::fromUcs2(aItem->GetUser2().GetBuffer()); + if ( ! tempAdd.isEmpty() ) { + additionalInfo += i18n("\nUser2: "); + additionalInfo += tempAdd;; + } + tempAdd = QString::fromUcs2(aItem->GetUser3().GetBuffer()); + if ( ! tempAdd.isEmpty() ) { + additionalInfo += i18n("\nUser3: "); + additionalInfo += tempAdd;; + } + tempAdd = QString::fromUcs2(aItem->GetUser4().GetBuffer()); + if ( ! tempAdd.isEmpty() ) { + additionalInfo += i18n("\nUser4: "); + additionalInfo += tempAdd;; + } + if (!additionalInfo.isEmpty() ) { + tempAdd = notesStr; + notesStr = "+++++++++++++++++++++++++++\n"; + notesStr += i18n("Additonal fields created\nby KA/Pi Outlook import:"); + notesStr += additionalInfo; + notesStr += i18n("\nEnd additonal fields created\nby KA/Pi Outlook import!\n"); + notesStr += "+++++++++++++++++++++++++++\n"; + notesStr += tempAdd; + } + addressee.setNote( notesStr ); #if 0 // pending - IM address: no clue where to get info about the helper ID -custom fields: difficult to implement - not implemented -keys: makes no sense #endif if ( addAddressee( addressee )) ++importedItems; } void KAImportOLdialog::slotCancel() { reject(); } bool KAImportOLdialog::addAddressee( KABC::Addressee a ) { bool add = true; KABC::Addressee::List::Iterator it; for ( it = mAList.begin(); it != mAList.end(); ++it ) { if ( (*it).uid() == a.uid() ) { add = false; break; } } if ( add ) { if ( mABook->findByUid(a.uid() ).isEmpty()) mAList.append ( a ); else add = false; } return add; } |