summaryrefslogtreecommitdiffabout
path: root/kabc
authorulf69 <ulf69>2004-07-13 15:00:05 (UTC)
committer ulf69 <ulf69>2004-07-13 15:00:05 (UTC)
commit65848bf858dae95799ec8ed883c23faa48ff8566 (patch) (unidiff)
tree74835d0d68caa5570b344b8494281786d00e57d5 /kabc
parenteb1ab908047072aa4fb224ab7da6e147d4dcf1e0 (diff)
downloadkdepimpi-65848bf858dae95799ec8ed883c23faa48ff8566.zip
kdepimpi-65848bf858dae95799ec8ed883c23faa48ff8566.tar.gz
kdepimpi-65848bf858dae95799ec8ed883c23faa48ff8566.tar.bz2
changed output of gender field. Now it can have the values "male", "female" or ""
Diffstat (limited to 'kabc') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/converter/opie/opieconverter.cpp13
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
@@ -187,33 +187,36 @@ bool OpieConverter::opieToAddressee( const OContact &contact, Addressee &addr )
187 PhoneNumber businesspager; 187 PhoneNumber businesspager;
188 businesspager.setType( PhoneNumber::Work | PhoneNumber::Pager ); 188 businesspager.setType( PhoneNumber::Work | PhoneNumber::Pager );
189 businesspager.setNumber( contact.businessPager() ); 189 businesspager.setNumber( contact.businessPager() );
190 addr.insertPhoneNumber( businesspager ); 190 addr.insertPhoneNumber( businesspager );
191 } 191 }
192 192
193 addr.setRole( contact.jobTitle() ); //? 193 addr.setRole( contact.jobTitle() ); //?
194 addr.setOrganization( contact.company() ); 194 addr.setOrganization( contact.company() );
195 addr.insertCustom( "KADDRESSBOOK", "X-Profession", contact.profession() ); 195 addr.insertCustom( "KADDRESSBOOK", "X-Profession", contact.profession() );
196 addr.insertCustom( "KADDRESSBOOK", "X-AssistantsName", contact.assistant() ); 196 addr.insertCustom( "KADDRESSBOOK", "X-AssistantsName", contact.assistant() );
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);
210 } 213 }
211 214
212 addr.insertCustom( "KADDRESSBOOK", "X-Children", contact.children() ); 215 addr.insertCustom( "KADDRESSBOOK", "X-Children", contact.children() );
213 if (contact.birthday().isValid()) 216 if (contact.birthday().isValid())
214 addr.setBirthday( contact.birthday() ); 217 addr.setBirthday( contact.birthday() );
215 218
216 addr.setNickName( contact.nickname() ); 219 addr.setNickName( contact.nickname() );
217 220
218 // others 221 // others
219 //US I put opies BusinessWebPage into Ka/Pi's notes block, because no other native field is available. 222 //US I put opies BusinessWebPage into Ka/Pi's notes block, because no other native field is available.
@@ -306,34 +309,38 @@ bool OpieConverter::addresseeToOpie( const Addressee &addr, OContact &contact )
306 309
307 PhoneNumber businesspager = addr.phoneNumber( PhoneNumber::Work | PhoneNumber::Pager ); 310 PhoneNumber businesspager = addr.phoneNumber( PhoneNumber::Work | PhoneNumber::Pager );
308 if (!businesspager.number().isEmpty()) 311 if (!businesspager.number().isEmpty())
309 contact.setBusinessPager(businesspager.number()); 312 contact.setBusinessPager(businesspager.number());
310 313
311 contact.setJobTitle(addr.role()); 314 contact.setJobTitle(addr.role());
312 contact.setCompany(addr.organization()); 315 contact.setCompany(addr.organization());
313 316
314 contact.setProfession(addr.custom( "KADDRESSBOOK", "X-Profession" )); 317 contact.setProfession(addr.custom( "KADDRESSBOOK", "X-Profession" ));
315 contact.setAssistant(addr.custom( "KADDRESSBOOK", "X-AssistantsName" )); 318 contact.setAssistant(addr.custom( "KADDRESSBOOK", "X-AssistantsName" ));
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
330 contact.setBirthday(addr.birthday().date()); 337 contact.setBirthday(addr.birthday().date());
331 contact.setNickname(addr.nickName()); 338 contact.setNickname(addr.nickName());
332 339
333 // other 340 // other
334 contact.setNotes(addr.note()); 341 contact.setNotes(addr.note());
335 342
336//US QString groups() const { return find( Qtopia::Groups ); } 343//US QString groups() const { return find( Qtopia::Groups ); }
337//US QStringList groupList() const; 344//US QStringList groupList() const;
338 345
339 QStringList cats = addr.categories(); 346 QStringList cats = addr.categories();