summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-09-15 15:06:44 (UTC)
committer zautrix <zautrix>2004-09-15 15:06:44 (UTC)
commitd37aeeb9aa023d52b364c971fa4aabd0c8f339b9 (patch) (side-by-side diff)
tree6d818d2c6dae0921b793f09e2ed569cbe7dd7d09
parent12091abdaa7e60e408fc248e286f37e12cb10a23 (diff)
downloadkdepimpi-d37aeeb9aa023d52b364c971fa4aabd0c8f339b9.zip
kdepimpi-d37aeeb9aa023d52b364c971fa4aabd0c8f339b9.tar.gz
kdepimpi-d37aeeb9aa023d52b364c971fa4aabd0c8f339b9.tar.bz2
KAPi OLE import changes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp2
-rw-r--r--kaddressbook/kaimportoldialog.cpp60
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
@@ -1690,49 +1690,49 @@ void KABCore::initActions()
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()
{
diff --git a/kaddressbook/kaimportoldialog.cpp b/kaddressbook/kaimportoldialog.cpp
index ef949e7..10e3c76 100644
--- a/kaddressbook/kaimportoldialog.cpp
+++ b/kaddressbook/kaimportoldialog.cpp
@@ -247,49 +247,49 @@ 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() )
@@ -582,49 +582,105 @@ void KAImportOLdialog::ol2kapiContact( _ContactItem * aItem )
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;
}