author | ulf69 <ulf69> | 2004-07-13 15:00:05 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-07-13 15:00:05 (UTC) |
commit | 65848bf858dae95799ec8ed883c23faa48ff8566 (patch) (side-by-side diff) | |
tree | 74835d0d68caa5570b344b8494281786d00e57d5 /kabc | |
parent | eb1ab908047072aa4fb224ab7da6e147d4dcf1e0 (diff) | |
download | kdepimpi-65848bf858dae95799ec8ed883c23faa48ff8566.zip kdepimpi-65848bf858dae95799ec8ed883c23faa48ff8566.tar.gz kdepimpi-65848bf858dae95799ec8ed883c23faa48ff8566.tar.bz2 |
changed output of gender field. Now it can have the values "male", "female" or ""
-rw-r--r-- | kabc/converter/opie/opieconverter.cpp | 13 |
1 files changed, 10 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 @@ -179,49 +179,52 @@ bool OpieConverter::opieToAddressee( const OContact &contact, Addressee &addr ) PhoneNumber businessmobile; businessmobile.setType( PhoneNumber::Work | PhoneNumber::Cell ); businessmobile.setNumber( contact.businessMobile() ); addr.insertPhoneNumber( businessmobile ); } if (!contact.businessPager().isEmpty()) { PhoneNumber businesspager; businesspager.setType( PhoneNumber::Work | PhoneNumber::Pager ); businesspager.setNumber( contact.businessPager() ); addr.insertPhoneNumber( businesspager ); } 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() ); addr.setNickName( contact.nickname() ); // others //US I put opies BusinessWebPage into Ka/Pi's notes block, because no other native field is available. QString notes = contact.notes(); notes += "\nBusinessWebPage: " + contact.businessWebpage() + "\n"; addr.setNote( contact.notes() ); //US QString groups() const { return find( Qtopia::Groups ); } @@ -298,50 +301,54 @@ bool OpieConverter::addresseeToOpie( const Addressee &addr, OContact &contact ) PhoneNumber businessfax = addr.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax ); if (!businessfax.number().isEmpty()) contact.setBusinessFax(businessfax.number()); PhoneNumber businessmobile = addr.phoneNumber( PhoneNumber::Work | PhoneNumber::Cell ); if (!businessmobile.number().isEmpty()) contact.setBusinessMobile(businessmobile.number()); PhoneNumber businesspager = addr.phoneNumber( PhoneNumber::Work | PhoneNumber::Pager ); if (!businesspager.number().isEmpty()) contact.setBusinessPager(businesspager.number()); 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()); //US QString groups() const { return find( Qtopia::Groups ); } //US QStringList groupList() const; QStringList cats = addr.categories(); QArray<int> iar; if ( !cats.isEmpty() ) { QArray<int> iar = catDB->ids("contact", cats); contact.setCategories(iar); } return true; |