-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 | |||
@@ -1666,97 +1666,97 @@ void KABCore::initActions() | |||
1666 | this, SLOT( configureKeyBindings() ), actionCollection(), | 1666 | this, SLOT( configureKeyBindings() ), actionCollection(), |
1667 | "kaddressbook_configure_shortcuts" ); | 1667 | "kaddressbook_configure_shortcuts" ); |
1668 | #ifdef KAB_EMBEDDED | 1668 | #ifdef KAB_EMBEDDED |
1669 | mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); | 1669 | mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); |
1670 | mActionConfigureToolbars->setEnabled( false ); | 1670 | mActionConfigureToolbars->setEnabled( false ); |
1671 | #endif //KAB_EMBEDDED | 1671 | #endif //KAB_EMBEDDED |
1672 | 1672 | ||
1673 | } else { | 1673 | } else { |
1674 | mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); | 1674 | mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); |
1675 | 1675 | ||
1676 | mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); | 1676 | mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); |
1677 | } | 1677 | } |
1678 | 1678 | ||
1679 | mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, | 1679 | mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, |
1680 | actionCollection(), "options_show_jump_bar" ); | 1680 | actionCollection(), "options_show_jump_bar" ); |
1681 | connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); | 1681 | connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); |
1682 | 1682 | ||
1683 | mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, | 1683 | mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, |
1684 | actionCollection(), "options_show_details" ); | 1684 | actionCollection(), "options_show_details" ); |
1685 | connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); | 1685 | connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); |
1686 | 1686 | ||
1687 | // misc | 1687 | // misc |
1688 | // only enable LDAP lookup if we can handle the protocol | 1688 | // only enable LDAP lookup if we can handle the protocol |
1689 | #ifndef KAB_EMBEDDED | 1689 | #ifndef KAB_EMBEDDED |
1690 | if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { | 1690 | if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { |
1691 | new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, | 1691 | new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, |
1692 | this, SLOT( openLDAPDialog() ), actionCollection(), | 1692 | this, SLOT( openLDAPDialog() ), actionCollection(), |
1693 | "ldap_lookup" ); | 1693 | "ldap_lookup" ); |
1694 | } | 1694 | } |
1695 | #else //KAB_EMBEDDED | 1695 | #else //KAB_EMBEDDED |
1696 | //qDebug("KABCore::initActions() LDAP has to be implemented"); | 1696 | //qDebug("KABCore::initActions() LDAP has to be implemented"); |
1697 | #endif //KAB_EMBEDDED | 1697 | #endif //KAB_EMBEDDED |
1698 | 1698 | ||
1699 | 1699 | ||
1700 | mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, | 1700 | mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, |
1701 | SLOT( setWhoAmI() ), actionCollection(), | 1701 | SLOT( setWhoAmI() ), actionCollection(), |
1702 | "set_personal" ); | 1702 | "set_personal" ); |
1703 | 1703 | ||
1704 | 1704 | ||
1705 | 1705 | ||
1706 | 1706 | ||
1707 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, | 1707 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, |
1708 | SLOT( setCategories() ), actionCollection(), | 1708 | SLOT( setCategories() ), actionCollection(), |
1709 | "edit_set_categories" ); | 1709 | "edit_set_categories" ); |
1710 | 1710 | ||
1711 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, | 1711 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, |
1712 | SLOT( removeVoice() ), actionCollection(), | 1712 | SLOT( removeVoice() ), actionCollection(), |
1713 | "remove_voice" ); | 1713 | "remove_voice" ); |
1714 | mActionImportOL = new KAction( i18n( "Import from OL..." ), 0, this, | 1714 | mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, |
1715 | SLOT( importFromOL() ), actionCollection(), | 1715 | SLOT( importFromOL() ), actionCollection(), |
1716 | "import_OL" ); | 1716 | "import_OL" ); |
1717 | #ifdef KAB_EMBEDDED | 1717 | #ifdef KAB_EMBEDDED |
1718 | mActionLicence = new KAction( i18n( "Licence" ), 0, | 1718 | mActionLicence = new KAction( i18n( "Licence" ), 0, |
1719 | this, SLOT( showLicence() ), actionCollection(), | 1719 | this, SLOT( showLicence() ), actionCollection(), |
1720 | "licence_about_data" ); | 1720 | "licence_about_data" ); |
1721 | mActionFaq = new KAction( i18n( "Faq" ), 0, | 1721 | mActionFaq = new KAction( i18n( "Faq" ), 0, |
1722 | this, SLOT( faq() ), actionCollection(), | 1722 | this, SLOT( faq() ), actionCollection(), |
1723 | "faq_about_data" ); | 1723 | "faq_about_data" ); |
1724 | 1724 | ||
1725 | mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, | 1725 | mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, |
1726 | this, SLOT( createAboutData() ), actionCollection(), | 1726 | this, SLOT( createAboutData() ), actionCollection(), |
1727 | "kaddressbook_about_data" ); | 1727 | "kaddressbook_about_data" ); |
1728 | #endif //KAB_EMBEDDED | 1728 | #endif //KAB_EMBEDDED |
1729 | 1729 | ||
1730 | clipboardDataChanged(); | 1730 | clipboardDataChanged(); |
1731 | connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); | 1731 | connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); |
1732 | connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); | 1732 | connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); |
1733 | } | 1733 | } |
1734 | 1734 | ||
1735 | //US we need this function, to plug all actions into the correct menues. | 1735 | //US we need this function, to plug all actions into the correct menues. |
1736 | // KDE uses a XML format to plug the actions, but we work her without this overhead. | 1736 | // KDE uses a XML format to plug the actions, but we work her without this overhead. |
1737 | void KABCore::addActionsManually() | 1737 | void KABCore::addActionsManually() |
1738 | { | 1738 | { |
1739 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); | 1739 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); |
1740 | 1740 | ||
1741 | #ifdef KAB_EMBEDDED | 1741 | #ifdef KAB_EMBEDDED |
1742 | QPopupMenu *fileMenu = new QPopupMenu( this ); | 1742 | QPopupMenu *fileMenu = new QPopupMenu( this ); |
1743 | QPopupMenu *editMenu = new QPopupMenu( this ); | 1743 | QPopupMenu *editMenu = new QPopupMenu( this ); |
1744 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 1744 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
1745 | 1745 | ||
1746 | KToolBar* tb = mMainWindow->toolBar(); | 1746 | KToolBar* tb = mMainWindow->toolBar(); |
1747 | 1747 | ||
1748 | #ifdef DESKTOP_VERSION | 1748 | #ifdef DESKTOP_VERSION |
1749 | QMenuBar* mb = mMainWindow->menuBar(); | 1749 | QMenuBar* mb = mMainWindow->menuBar(); |
1750 | 1750 | ||
1751 | //US setup menubar. | 1751 | //US setup menubar. |
1752 | //Disable the following block if you do not want to have a menubar. | 1752 | //Disable the following block if you do not want to have a menubar. |
1753 | mb->insertItem( "&File", fileMenu ); | 1753 | mb->insertItem( "&File", fileMenu ); |
1754 | mb->insertItem( "&Edit", editMenu ); | 1754 | mb->insertItem( "&Edit", editMenu ); |
1755 | mb->insertItem( "&View", viewMenu ); | 1755 | mb->insertItem( "&View", viewMenu ); |
1756 | mb->insertItem( "&Settings", settingsMenu ); | 1756 | mb->insertItem( "&Settings", settingsMenu ); |
1757 | mb->insertItem( "&Change selected", changeMenu ); | 1757 | mb->insertItem( "&Change selected", changeMenu ); |
1758 | mb->insertItem( "&Help", helpMenu ); | 1758 | mb->insertItem( "&Help", helpMenu ); |
1759 | mIncSearchWidget = new IncSearchWidget( tb ); | 1759 | mIncSearchWidget = new IncSearchWidget( tb ); |
1760 | // tb->insertWidget(-1, 0, mIncSearchWidget); | 1760 | // tb->insertWidget(-1, 0, mIncSearchWidget); |
1761 | 1761 | ||
1762 | #else | 1762 | #else |
diff --git a/kaddressbook/kaimportoldialog.cpp b/kaddressbook/kaimportoldialog.cpp index ef949e7..10e3c76 100644 --- a/kaddressbook/kaimportoldialog.cpp +++ b/kaddressbook/kaimportoldialog.cpp | |||
@@ -223,97 +223,97 @@ void KAImportOLdialog::readContactData( DWORD folder ) | |||
223 | int w = 300; | 223 | int w = 300; |
224 | int dw = QApplication::desktop()->width(); | 224 | int dw = QApplication::desktop()->width(); |
225 | int dh = QApplication::desktop()->height(); | 225 | int dh = QApplication::desktop()->height(); |
226 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 226 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
227 | bar.show(); | 227 | bar.show(); |
228 | for(i=1; i <= folderItems.GetCount(); ++i) | 228 | for(i=1; i <= folderItems.GetCount(); ++i) |
229 | { | 229 | { |
230 | qApp->processEvents(); | 230 | qApp->processEvents(); |
231 | if ( ! bar.isVisible() ) | 231 | if ( ! bar.isVisible() ) |
232 | return ; | 232 | return ; |
233 | bar.setProgress( i ); | 233 | bar.setProgress( i ); |
234 | indx = (long)i; | 234 | indx = (long)i; |
235 | itm = folderItems.Item(indx.Detach()); | 235 | itm = folderItems.Item(indx.Detach()); |
236 | _ContactItem * pItem = (_ContactItem *)&itm; | 236 | _ContactItem * pItem = (_ContactItem *)&itm; |
237 | ol2kapiContact( pItem ); | 237 | ol2kapiContact( pItem ); |
238 | itm->Release(); | 238 | itm->Release(); |
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 | //GetLastModificationTime() | 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 | ||
264 | //QString::fromUcs2(aItem->.GetBuffer()) | 264 | //QString::fromUcs2(aItem->.GetBuffer()) |
265 | //addressee.setMailer( const QString &mailer ); | 265 | //addressee.setMailer( const QString &mailer ); |
266 | //addressee.setTimeZone( const TimeZone &timeZone ); | 266 | //addressee.setTimeZone( const TimeZone &timeZone ); |
267 | //addressee.setGeo( const Geo &geo ); | 267 | //addressee.setGeo( const Geo &geo ); |
268 | //addressee.setTitle( QString::fromUcs2(aItem->GetJobTitle().GetBuffer()) );// titel is the prefix | 268 | //addressee.setTitle( QString::fromUcs2(aItem->GetJobTitle().GetBuffer()) );// titel is the prefix |
269 | addressee.setRole( QString::fromUcs2(aItem->GetJobTitle().GetBuffer()) ); | 269 | addressee.setRole( QString::fromUcs2(aItem->GetJobTitle().GetBuffer()) ); |
270 | addressee.setOrganization( QString::fromUcs2(aItem->GetCompanyName().GetBuffer()) ); | 270 | addressee.setOrganization( QString::fromUcs2(aItem->GetCompanyName().GetBuffer()) ); |
271 | addressee.setNote( QString::fromUcs2(aItem->GetBody().GetBuffer()) ); | 271 | QString notesStr = QString::fromUcs2(aItem->GetBody().GetBuffer()); |
272 | 272 | ||
273 | addressee.setProductId( QString::fromUcs2(aItem->GetCustomerID().GetBuffer()) ); | 273 | addressee.setProductId( QString::fromUcs2(aItem->GetCustomerID().GetBuffer()) ); |
274 | //addressee.setRevision( const QDateTime &revision ); | 274 | //addressee.setRevision( const QDateTime &revision ); |
275 | // addressee.setSortString( const QString &sortString ); | 275 | // addressee.setSortString( const QString &sortString ); |
276 | addressee.setUrl( QString::fromUcs2(aItem->GetWebPage().GetBuffer()) ); | 276 | addressee.setUrl( QString::fromUcs2(aItem->GetWebPage().GetBuffer()) ); |
277 | 277 | ||
278 | QString tempS; | 278 | QString tempS; |
279 | tempS = QString::fromUcs2(aItem->GetNetMeetingAlias().GetBuffer())+" AT SERVER: " +QString::fromUcs2(aItem->GetNetMeetingServer().GetBuffer()); | 279 | tempS = QString::fromUcs2(aItem->GetNetMeetingAlias().GetBuffer())+" AT SERVER: " +QString::fromUcs2(aItem->GetNetMeetingServer().GetBuffer()); |
280 | if ( tempS.length() > 12 ) | 280 | if ( tempS.length() > 12 ) |
281 | addressee.insertCustom( "KADDRESSBOOK", "X-IMAddress", tempS ); | 281 | addressee.insertCustom( "KADDRESSBOOK", "X-IMAddress", tempS ); |
282 | tempS = QString::fromUcs2(aItem->GetSpouse().GetBuffer()); | 282 | tempS = QString::fromUcs2(aItem->GetSpouse().GetBuffer()); |
283 | if ( !tempS.isEmpty() ) | 283 | if ( !tempS.isEmpty() ) |
284 | addressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", tempS ); | 284 | addressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", tempS ); |
285 | tempS = QString::fromUcs2(aItem->GetManagerName().GetBuffer()); | 285 | tempS = QString::fromUcs2(aItem->GetManagerName().GetBuffer()); |
286 | if ( !tempS.isEmpty() ) | 286 | if ( !tempS.isEmpty() ) |
287 | addressee.insertCustom( "KADDRESSBOOK", "X-ManagersName", tempS ); | 287 | addressee.insertCustom( "KADDRESSBOOK", "X-ManagersName", tempS ); |
288 | tempS = QString::fromUcs2(aItem->GetAssistantName().GetBuffer()); | 288 | tempS = QString::fromUcs2(aItem->GetAssistantName().GetBuffer()); |
289 | if ( !tempS.isEmpty() ) | 289 | if ( !tempS.isEmpty() ) |
290 | addressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName", tempS ); | 290 | addressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName", tempS ); |
291 | tempS = QString::fromUcs2(aItem->GetDepartment().GetBuffer()); | 291 | tempS = QString::fromUcs2(aItem->GetDepartment().GetBuffer()); |
292 | if ( !tempS.isEmpty() ) | 292 | if ( !tempS.isEmpty() ) |
293 | addressee.insertCustom( "KADDRESSBOOK", "X-Department", tempS ); | 293 | addressee.insertCustom( "KADDRESSBOOK", "X-Department", tempS ); |
294 | tempS = QString::fromUcs2(aItem->GetOfficeLocation().GetBuffer()); | 294 | tempS = QString::fromUcs2(aItem->GetOfficeLocation().GetBuffer()); |
295 | if ( !tempS.isEmpty() ) | 295 | if ( !tempS.isEmpty() ) |
296 | addressee.insertCustom( "KADDRESSBOOK", "X-Office",tempS ); | 296 | addressee.insertCustom( "KADDRESSBOOK", "X-Office",tempS ); |
297 | tempS = QString::fromUcs2(aItem->GetProfession().GetBuffer()); | 297 | tempS = QString::fromUcs2(aItem->GetProfession().GetBuffer()); |
298 | if ( !tempS.isEmpty() ) | 298 | if ( !tempS.isEmpty() ) |
299 | addressee.insertCustom( "KADDRESSBOOK", "X-Profession", tempS ); | 299 | addressee.insertCustom( "KADDRESSBOOK", "X-Profession", tempS ); |
300 | dtb = mDdate2Qdtr(aItem->GetAnniversary()); | 300 | dtb = mDdate2Qdtr(aItem->GetAnniversary()); |
301 | if (dtb.isValid() ) { | 301 | if (dtb.isValid() ) { |
302 | QString dt = KGlobal::locale()->formatDate( dtb.date() , true, KLocale::ISODate); | 302 | QString dt = KGlobal::locale()->formatDate( dtb.date() , true, KLocale::ISODate); |
303 | addressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt); | 303 | addressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt); |
304 | } | 304 | } |
305 | int sec = aItem->GetSensitivity() ; | 305 | int sec = aItem->GetSensitivity() ; |
306 | if ( sec > 1 )// mapping pers -> private | 306 | if ( sec > 1 )// mapping pers -> private |
307 | --sec; | 307 | --sec; |
308 | addressee.setSecrecy( sec ); | 308 | addressee.setSecrecy( sec ); |
309 | //addressee.setLogo( const Picture &logo ); | 309 | //addressee.setLogo( const Picture &logo ); |
310 | //addressee.setPhoto( const Picture &photo ); | 310 | //addressee.setPhoto( const Picture &photo ); |
311 | //addressee.setSound( const Sound &sound ); | 311 | //addressee.setSound( const Sound &sound ); |
312 | //addressee.setAgent( const Agent &agent ); | 312 | //addressee.setAgent( const Agent &agent ); |
313 | QString cat = QString::fromUcs2( aItem->GetCategories().GetBuffer()); | 313 | QString cat = QString::fromUcs2( aItem->GetCategories().GetBuffer()); |
314 | addressee.setCategories( QStringList::split( ";", cat )); | 314 | addressee.setCategories( QStringList::split( ";", cat )); |
315 | 315 | ||
316 | QString phoneS; | 316 | QString phoneS; |
317 | 317 | ||
318 | phoneS = QString::fromUcs2( aItem->GetAssistantTelephoneNumber().GetBuffer()); | 318 | phoneS = QString::fromUcs2( aItem->GetAssistantTelephoneNumber().GetBuffer()); |
319 | if ( ! phoneS.isEmpty()) | 319 | if ( ! phoneS.isEmpty()) |
@@ -558,82 +558,138 @@ void KAImportOLdialog::ol2kapiContact( _ContactItem * aItem ) | |||
558 | // redundant ! addressAdd->setExtended(phoneS ); | 558 | // redundant ! addressAdd->setExtended(phoneS ); |
559 | // insert = true; | 559 | // insert = true; |
560 | } | 560 | } |
561 | addressAdd->setType( KABC::Address::Postal ); | 561 | addressAdd->setType( KABC::Address::Postal ); |
562 | if ( insert ) { | 562 | if ( insert ) { |
563 | addressee.insertAddress( *addressAdd ); | 563 | addressee.insertAddress( *addressAdd ); |
564 | } | 564 | } |
565 | // the following code is disabled | 565 | // the following code is disabled |
566 | // it does not seem to be useful | 566 | // it does not seem to be useful |
567 | #if 0 | 567 | #if 0 |
568 | if ( insert ) { | 568 | if ( insert ) { |
569 | addressAdd->setType( KABC::Address::Home ); | 569 | addressAdd->setType( KABC::Address::Home ); |
570 | if ( addressMail == addressHome ) { | 570 | if ( addressMail == addressHome ) { |
571 | addressHome.setType( KABC::Address::Postal+ KABC::Address::Home ); | 571 | addressHome.setType( KABC::Address::Postal+ KABC::Address::Home ); |
572 | addressee.insertAddress( addressHome ); | 572 | addressee.insertAddress( addressHome ); |
573 | } else { | 573 | } else { |
574 | addressAdd->setType( KABC::Address::Work ); | 574 | addressAdd->setType( KABC::Address::Work ); |
575 | if ( addressMail == addressWork ){ | 575 | if ( addressMail == addressWork ){ |
576 | addressWork.setType( KABC::Address::Postal+ KABC::Address::Work ); | 576 | addressWork.setType( KABC::Address::Postal+ KABC::Address::Work ); |
577 | addressee.insertAddress( addressWork ); | 577 | addressee.insertAddress( addressWork ); |
578 | 578 | ||
579 | } else { | 579 | } else { |
580 | addressAdd->setType( 0 ); | 580 | addressAdd->setType( 0 ); |
581 | if ( addressOther == addressMail ){ | 581 | if ( addressOther == addressMail ){ |
582 | addressOther.setType( KABC::Address::Postal ); | 582 | addressOther.setType( KABC::Address::Postal ); |
583 | addressee.insertAddress( addressOther ); | 583 | addressee.insertAddress( addressOther ); |
584 | } else { | 584 | } else { |
585 | addressee.insertAddress( *addressAdd ); | 585 | addressee.insertAddress( *addressAdd ); |
586 | } | 586 | } |
587 | } | 587 | } |
588 | } | 588 | } |
589 | } | 589 | } |
590 | #endif | 590 | #endif |
591 | // ++++++++++++++++++++++ end of ALL addresses | 591 | // ++++++++++++++++++++++ end of ALL addresses |
592 | //GetUserProperties(); | 592 | //GetUserProperties(); |
593 | tempS = QString::fromUcs2(aItem->GetInternetFreeBusyAddress().GetBuffer()); | 593 | tempS = QString::fromUcs2(aItem->GetInternetFreeBusyAddress().GetBuffer()); |
594 | if ( !tempS.isEmpty() ) | 594 | if ( !tempS.isEmpty() ) |
595 | addressee.insertCustom( "KADDRESSBOOK", "X-FreeBusyUrl", tempS ); | 595 | addressee.insertCustom( "KADDRESSBOOK", "X-FreeBusyUrl", tempS ); |
596 | tempS = QString::fromUcs2(aItem->GetChildren().GetBuffer()); | 596 | tempS = QString::fromUcs2(aItem->GetChildren().GetBuffer()); |
597 | if ( !tempS.isEmpty() ) | 597 | if ( !tempS.isEmpty() ) |
598 | addressee.insertCustom( "KADDRESSBOOK", "X-Children", tempS ); | 598 | addressee.insertCustom( "KADDRESSBOOK", "X-Children", tempS ); |
599 | int gen = aItem->GetGender(); | 599 | int gen = aItem->GetGender(); |
600 | if ( gen != 0 ) { // 0 undef - 1 female - 2 male | 600 | if ( gen != 0 ) { // 0 undef - 1 female - 2 male |
601 | if ( gen == 1 ) | 601 | if ( gen == 1 ) |
602 | addressee.insertCustom( "KADDRESSBOOK", "X-Gender", "female" ); | 602 | addressee.insertCustom( "KADDRESSBOOK", "X-Gender", "female" ); |
603 | else | 603 | else |
604 | addressee.insertCustom( "KADDRESSBOOK", "X-Gender", "male" ); | 604 | addressee.insertCustom( "KADDRESSBOOK", "X-Gender", "male" ); |
605 | } | 605 | } |
606 | 606 | QString additionalInfo; | |
607 | QString tempAdd; | ||
608 | tempAdd = QString::fromUcs2(aItem->GetLanguage().GetBuffer()); | ||
609 | if ( ! tempAdd.isEmpty() ) { | ||
610 | additionalInfo += i18n("\nLanguage: "); | ||
611 | additionalInfo += tempAdd; | ||
612 | } | ||
613 | tempAdd = QString::fromUcs2(aItem->GetHobby().GetBuffer()); | ||
614 | if ( ! tempAdd.isEmpty() ) { | ||
615 | additionalInfo += i18n("\nHobby: "); | ||
616 | additionalInfo += tempAdd;; | ||
617 | } | ||
618 | tempAdd =QString::fromUcs2(aItem->GetPersonalHomePage().GetBuffer()); | ||
619 | if ( ! tempAdd.isEmpty() ) { | ||
620 | additionalInfo += i18n("\nHomepage: "); | ||
621 | additionalInfo += tempAdd;; | ||
622 | } | ||
623 | tempAdd = QString::fromUcs2(aItem->GetBillingInformation().GetBuffer()); | ||
624 | if ( ! tempAdd.isEmpty() ) { | ||
625 | additionalInfo += i18n("\nBilling information: "); | ||
626 | additionalInfo += tempAdd;; | ||
627 | } | ||
628 | tempAdd = QString::fromUcs2(aItem->GetCustomerID().GetBuffer()); | ||
629 | if ( ! tempAdd.isEmpty() ) { | ||
630 | additionalInfo += i18n("\nCustomer ID: "); | ||
631 | additionalInfo += tempAdd;; | ||
632 | } | ||
633 | tempAdd = QString::fromUcs2(aItem->GetUser1().GetBuffer()); | ||
634 | if ( ! tempAdd.isEmpty() ) { | ||
635 | additionalInfo += i18n("\nUser1: "); | ||
636 | additionalInfo += tempAdd;; | ||
637 | } | ||
638 | tempAdd = QString::fromUcs2(aItem->GetUser2().GetBuffer()); | ||
639 | if ( ! tempAdd.isEmpty() ) { | ||
640 | additionalInfo += i18n("\nUser2: "); | ||
641 | additionalInfo += tempAdd;; | ||
642 | } | ||
643 | tempAdd = QString::fromUcs2(aItem->GetUser3().GetBuffer()); | ||
644 | if ( ! tempAdd.isEmpty() ) { | ||
645 | additionalInfo += i18n("\nUser3: "); | ||
646 | additionalInfo += tempAdd;; | ||
647 | } | ||
648 | tempAdd = QString::fromUcs2(aItem->GetUser4().GetBuffer()); | ||
649 | if ( ! tempAdd.isEmpty() ) { | ||
650 | additionalInfo += i18n("\nUser4: "); | ||
651 | additionalInfo += tempAdd;; | ||
652 | } | ||
653 | if (!additionalInfo.isEmpty() ) { | ||
654 | tempAdd = notesStr; | ||
655 | notesStr = "+++++++++++++++++++++++++++\n"; | ||
656 | notesStr += i18n("Additonal fields created\nby KA/Pi Outlook import:"); | ||
657 | notesStr += additionalInfo; | ||
658 | notesStr += i18n("\nEnd additonal fields created\nby KA/Pi Outlook import!\n"); | ||
659 | notesStr += "+++++++++++++++++++++++++++\n"; | ||
660 | notesStr += tempAdd; | ||
661 | } | ||
662 | addressee.setNote( notesStr ); | ||
607 | #if 0 | 663 | #if 0 |
608 | // pending | 664 | // pending |
609 | - IM address: no clue where to get info about the helper ID | 665 | - IM address: no clue where to get info about the helper ID |
610 | -custom fields: difficult to implement - not implemented | 666 | -custom fields: difficult to implement - not implemented |
611 | -keys: makes no sense | 667 | -keys: makes no sense |
612 | #endif | 668 | #endif |
613 | 669 | ||
614 | if ( addAddressee( addressee )) | 670 | if ( addAddressee( addressee )) |
615 | ++importedItems; | 671 | ++importedItems; |
616 | } | 672 | } |
617 | void KAImportOLdialog::slotCancel() | 673 | void KAImportOLdialog::slotCancel() |
618 | { | 674 | { |
619 | reject(); | 675 | reject(); |
620 | } | 676 | } |
621 | 677 | ||
622 | bool KAImportOLdialog::addAddressee( KABC::Addressee a ) | 678 | bool KAImportOLdialog::addAddressee( KABC::Addressee a ) |
623 | { | 679 | { |
624 | bool add = true; | 680 | bool add = true; |
625 | KABC::Addressee::List::Iterator it; | 681 | KABC::Addressee::List::Iterator it; |
626 | for ( it = mAList.begin(); it != mAList.end(); ++it ) { | 682 | for ( it = mAList.begin(); it != mAList.end(); ++it ) { |
627 | if ( (*it).uid() == a.uid() ) { | 683 | if ( (*it).uid() == a.uid() ) { |
628 | add = false; | 684 | add = false; |
629 | break; | 685 | break; |
630 | } | 686 | } |
631 | } | 687 | } |
632 | if ( add ) { | 688 | if ( add ) { |
633 | if ( mABook->findByUid(a.uid() ).isEmpty()) | 689 | if ( mABook->findByUid(a.uid() ).isEmpty()) |
634 | mAList.append ( a ); | 690 | mAList.append ( a ); |
635 | else | 691 | else |
636 | add = false; | 692 | add = false; |
637 | } | 693 | } |
638 | return add; | 694 | return add; |
639 | } | 695 | } |