summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kabc/converter/opie/opieconverter.cpp11
-rw-r--r--kaddressbook/kabcore.cpp3
2 files changed, 11 insertions, 3 deletions
diff --git a/kabc/converter/opie/opieconverter.cpp b/kabc/converter/opie/opieconverter.cpp
index 0b6a55e..46e14dd 100644
--- a/kabc/converter/opie/opieconverter.cpp
+++ b/kabc/converter/opie/opieconverter.cpp
@@ -191,25 +191,28 @@ bool OpieConverter::opieToAddressee( const OContact &contact, Addressee &addr )
}
addr.setRole( contact.jobTitle() ); //?
addr.setOrganization( contact.company() );
addr.insertCustom( "KADDRESSBOOK", "X-Profession", contact.profession() );
addr.insertCustom( "KADDRESSBOOK", "X-AssistantsName", contact.assistant() );
addr.insertCustom( "KADDRESSBOOK", "X-Department", contact.department() );
addr.insertCustom( "KADDRESSBOOK", "X-ManagersName", contact.manager() );
addr.insertCustom( "KADDRESSBOOK", "X-Office", contact.office() );
//personal
addr.insertCustom( "KADDRESSBOOK", "X-SpousesName", contact.spouse() );
- addr.insertCustom( "KADDRESSBOOK", "X-Gender", contact.gender() );
+ if (contact.gender() == 1)
+ addr.insertCustom( "KADDRESSBOOK", "X-Gender", "female" );
+ else if (contact.gender() == 2)
+ addr.insertCustom( "KADDRESSBOOK", "X-Gender", "male" );
if (contact.anniversary().isValid()) {
QString dt = KGlobal::locale()->formatDate(contact.anniversary(), true, KLocale::ISODate);
//US
qDebug("OpieConverter::opieToAddressee found:%s", dt.latin1());
addr.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt);
}
addr.insertCustom( "KADDRESSBOOK", "X-Children", contact.children() );
if (contact.birthday().isValid())
addr.setBirthday( contact.birthday() );
@@ -310,25 +313,29 @@ bool OpieConverter::addresseeToOpie( const Addressee &addr, OContact &contact )
contact.setJobTitle(addr.role());
contact.setCompany(addr.organization());
contact.setProfession(addr.custom( "KADDRESSBOOK", "X-Profession" ));
contact.setAssistant(addr.custom( "KADDRESSBOOK", "X-AssistantsName" ));
contact.setDepartment(addr.custom( "KADDRESSBOOK", "X-Department" ));
contact.setManager(addr.custom( "KADDRESSBOOK", "X-ManagersName" ));
contact.setOffice(addr.custom( "KADDRESSBOOK", "X-Office" ));
//personal
contact.setSpouse(addr.custom( "KADDRESSBOOK", "X-Spouse" ));
- contact.setGender(addr.custom( "KADDRESSBOOK", "X-Gender" ));
+ QString gend = addr.custom( "KADDRESSBOOK", "X-Gender" );
+ if (gend == "female")
+ contact.setGender("1");
+ else if (gend == "male")
+ contact.setGender("2");
QDate dt = KGlobal::locale()->readDate(
addr.custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); // = Qt::ISODate
contact.setAnniversary( dt );
contact.setChildren(addr.custom( "KADDRESSBOOK", "X-Children" ));
contact.setBirthday(addr.birthday().date());
contact.setNickname(addr.nickName());
// other
contact.setNotes(addr.note());
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 1a34e4d..8daca33 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -154,25 +154,26 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
"X-AssistantsName", "KADDRESSBOOK" );
mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization,
"X-ManagersName", "KADDRESSBOOK" );
mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal,
"X-SpousesName", "KADDRESSBOOK" );
mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal,
"X-Office", "KADDRESSBOOK" );
mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal,
"X-IMAddress", "KADDRESSBOOK" );
mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal,
"X-Anniversary", "KADDRESSBOOK" );
-//US added this field to become compatible with Opie addressbook
+ //US added this field to become compatible with Opie/qtopia addressbook
+ // values can be "female" or "male" or "". An empty field represents undefined.
mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal,
"X-Gender", "KADDRESSBOOK" );
mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal,
"X-Children", "KADDRESSBOOK" );
mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal,
"X-FreeBusyUrl", "KADDRESSBOOK" );
initGUI();
mIncSearchWidget->setFocus();