-rw-r--r-- | kabc/converter/opie/opieconverter.cpp | 13 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 3 |
2 files changed, 12 insertions, 4 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 | |||
@@ -197,13 +197,16 @@ bool OpieConverter::opieToAddressee( const OContact &contact, Addressee &addr ) | |||
197 | addr.insertCustom( "KADDRESSBOOK", "X-Department", contact.department() ); | 197 | addr.insertCustom( "KADDRESSBOOK", "X-Department", contact.department() ); |
198 | addr.insertCustom( "KADDRESSBOOK", "X-ManagersName", contact.manager() ); | 198 | addr.insertCustom( "KADDRESSBOOK", "X-ManagersName", contact.manager() ); |
199 | addr.insertCustom( "KADDRESSBOOK", "X-Office", contact.office() ); | 199 | addr.insertCustom( "KADDRESSBOOK", "X-Office", contact.office() ); |
200 | 200 | ||
201 | //personal | 201 | //personal |
202 | addr.insertCustom( "KADDRESSBOOK", "X-SpousesName", contact.spouse() ); | 202 | addr.insertCustom( "KADDRESSBOOK", "X-SpousesName", contact.spouse() ); |
203 | addr.insertCustom( "KADDRESSBOOK", "X-Gender", contact.gender() ); | 203 | if (contact.gender() == 1) |
204 | addr.insertCustom( "KADDRESSBOOK", "X-Gender", "female" ); | ||
205 | else if (contact.gender() == 2) | ||
206 | addr.insertCustom( "KADDRESSBOOK", "X-Gender", "male" ); | ||
204 | 207 | ||
205 | if (contact.anniversary().isValid()) { | 208 | if (contact.anniversary().isValid()) { |
206 | QString dt = KGlobal::locale()->formatDate(contact.anniversary(), true, KLocale::ISODate); | 209 | QString dt = KGlobal::locale()->formatDate(contact.anniversary(), true, KLocale::ISODate); |
207 | //US | 210 | //US |
208 | qDebug("OpieConverter::opieToAddressee found:%s", dt.latin1()); | 211 | qDebug("OpieConverter::opieToAddressee found:%s", dt.latin1()); |
209 | addr.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt); | 212 | addr.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt); |
@@ -316,14 +319,18 @@ bool OpieConverter::addresseeToOpie( const Addressee &addr, OContact &contact ) | |||
316 | contact.setDepartment(addr.custom( "KADDRESSBOOK", "X-Department" )); | 319 | contact.setDepartment(addr.custom( "KADDRESSBOOK", "X-Department" )); |
317 | contact.setManager(addr.custom( "KADDRESSBOOK", "X-ManagersName" )); | 320 | contact.setManager(addr.custom( "KADDRESSBOOK", "X-ManagersName" )); |
318 | contact.setOffice(addr.custom( "KADDRESSBOOK", "X-Office" )); | 321 | contact.setOffice(addr.custom( "KADDRESSBOOK", "X-Office" )); |
319 | 322 | ||
320 | //personal | 323 | //personal |
321 | contact.setSpouse(addr.custom( "KADDRESSBOOK", "X-Spouse" )); | 324 | contact.setSpouse(addr.custom( "KADDRESSBOOK", "X-Spouse" )); |
322 | contact.setGender(addr.custom( "KADDRESSBOOK", "X-Gender" )); | 325 | QString gend = addr.custom( "KADDRESSBOOK", "X-Gender" ); |
323 | 326 | if (gend == "female") | |
327 | contact.setGender("1"); | ||
328 | else if (gend == "male") | ||
329 | contact.setGender("2"); | ||
330 | |||
324 | QDate dt = KGlobal::locale()->readDate( | 331 | QDate dt = KGlobal::locale()->readDate( |
325 | addr.custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); // = Qt::ISODate | 332 | addr.custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); // = Qt::ISODate |
326 | contact.setAnniversary( dt ); | 333 | contact.setAnniversary( dt ); |
327 | 334 | ||
328 | contact.setChildren(addr.custom( "KADDRESSBOOK", "X-Children" )); | 335 | contact.setChildren(addr.custom( "KADDRESSBOOK", "X-Children" )); |
329 | 336 | ||
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 1a34e4d..8daca33 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -160,13 +160,14 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const | |||
160 | "X-Office", "KADDRESSBOOK" ); | 160 | "X-Office", "KADDRESSBOOK" ); |
161 | mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, | 161 | mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, |
162 | "X-IMAddress", "KADDRESSBOOK" ); | 162 | "X-IMAddress", "KADDRESSBOOK" ); |
163 | mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, | 163 | mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, |
164 | "X-Anniversary", "KADDRESSBOOK" ); | 164 | "X-Anniversary", "KADDRESSBOOK" ); |
165 | 165 | ||
166 | //US added this field to become compatible with Opie addressbook | 166 | //US added this field to become compatible with Opie/qtopia addressbook |
167 | // values can be "female" or "male" or "". An empty field represents undefined. | ||
167 | mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, | 168 | mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, |
168 | "X-Gender", "KADDRESSBOOK" ); | 169 | "X-Gender", "KADDRESSBOOK" ); |
169 | mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, | 170 | mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, |
170 | "X-Children", "KADDRESSBOOK" ); | 171 | "X-Children", "KADDRESSBOOK" ); |
171 | mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, | 172 | mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, |
172 | "X-FreeBusyUrl", "KADDRESSBOOK" ); | 173 | "X-FreeBusyUrl", "KADDRESSBOOK" ); |