-rw-r--r-- | kabc/plugins/sharpdtm/sharpdtmconverter.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/kabc/plugins/sharpdtm/sharpdtmconverter.cpp b/kabc/plugins/sharpdtm/sharpdtmconverter.cpp index ae4cfbb..8165b4c 100644 --- a/kabc/plugins/sharpdtm/sharpdtmconverter.cpp +++ b/kabc/plugins/sharpdtm/sharpdtmconverter.cpp | |||
@@ -80,7 +80,8 @@ bool SharpDTMConverter::sharpToAddressee( const CardId &contact, const SlZDataBa | |||
80 | 80 | ||
81 | // name | 81 | // name |
82 | //qDebug("SharpDTMConverter::sharpToAddressee check if the fileAs transformation works!!"); | 82 | //qDebug("SharpDTMConverter::sharpToAddressee check if the fileAs transformation works!!"); |
83 | addr.setFormattedName(db->readField(ZdbAdrs::FileAs)); // needs fix | 83 | addr.setFormattedName(db->readField(ZdbAdrs::FileAs)); |
84 | addr.setName(db->readField(ZdbAdrs::FullName)); | ||
84 | 85 | ||
85 | addr.setFamilyName( db->readField(ZdbAdrs::LastName) ); | 86 | addr.setFamilyName( db->readField(ZdbAdrs::LastName) ); |
86 | addr.setGivenName( db->readField(ZdbAdrs::FirstName) ); | 87 | addr.setGivenName( db->readField(ZdbAdrs::FirstName) ); |
@@ -222,11 +223,12 @@ bool SharpDTMConverter::sharpToAddressee( const CardId &contact, const SlZDataBa | |||
222 | QString gen = db->readField(ZdbAdrs::Gender); | 223 | QString gen = db->readField(ZdbAdrs::Gender); |
223 | //qDebug("SharpDTMConverter::sharpToAddressee pleas check that gender works!! : Gender: %s", gen.latin1()); | 224 | //qDebug("SharpDTMConverter::sharpToAddressee pleas check that gender works!! : Gender: %s", gen.latin1()); |
224 | //qDebug("SharpDTMConverter::sharpToAddressee: may be int db->readUshortField(\"ZdbAdrs::Gender\") is here better suited"); | 225 | //qDebug("SharpDTMConverter::sharpToAddressee: may be int db->readUshortField(\"ZdbAdrs::Gender\") is here better suited"); |
225 | 226 | if (gen == "1") | |
226 | if (gen == "male") | ||
227 | addr.insertCustom( "KADDRESSBOOK", "X-Gender", "male"); | 227 | addr.insertCustom( "KADDRESSBOOK", "X-Gender", "male"); |
228 | else if (gen == "female") | 228 | else if (gen == "2") |
229 | addr.insertCustom( "KADDRESSBOOK", "X-Gender", "female"); | 229 | addr.insertCustom( "KADDRESSBOOK", "X-Gender", "female"); |
230 | else | ||
231 | addr.insertCustom( "KADDRESSBOOK", "X-Gender", "undef"); | ||
230 | 232 | ||
231 | 233 | ||
232 | QDate ann = KGlobal::locale()->readDate( db->readField(ZdbAdrs::Anniversary) ); | 234 | QDate ann = KGlobal::locale()->readDate( db->readField(ZdbAdrs::Anniversary) ); |
@@ -234,7 +236,9 @@ bool SharpDTMConverter::sharpToAddressee( const CardId &contact, const SlZDataBa | |||
234 | QString dt = KGlobal::locale()->formatDate(ann, true, KLocale::ISODate); | 236 | QString dt = KGlobal::locale()->formatDate(ann, true, KLocale::ISODate); |
235 | //qDebug("qtopiaToAddressee annyversary found:%s", dt.latin1()); | 237 | //qDebug("qtopiaToAddressee annyversary found:%s", dt.latin1()); |
236 | addr.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt); | 238 | addr.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt); |
237 | } | 239 | } else |
240 | addr.insertCustom( "KADDRESSBOOK", "X-Anniversary", " "); | ||
241 | |||
238 | 242 | ||
239 | 243 | ||
240 | addr.insertCustom( "KADDRESSBOOK", "X-Children", db->readField(ZdbAdrs::Children) ); | 244 | addr.insertCustom( "KADDRESSBOOK", "X-Children", db->readField(ZdbAdrs::Children) ); |
@@ -298,7 +302,7 @@ bool SharpDTMConverter::addresseeToSharp( const Addressee &addr, SlZDataBase* da | |||
298 | formattedName = addr.givenName(); | 302 | formattedName = addr.givenName(); |
299 | } | 303 | } |
300 | database->writeField(ZdbAdrs::FileAs, formattedName); | 304 | database->writeField(ZdbAdrs::FileAs, formattedName); |
301 | database->writeField(ZdbAdrs::FullName, formattedName); | 305 | database->writeField(ZdbAdrs::FullName, addr.name()); |
302 | 306 | ||
303 | 307 | ||
304 | //qDebug("SharpDTMConverter::addresseeToSharp check which seperator we need here for the emails!!"); | 308 | //qDebug("SharpDTMConverter::addresseeToSharp check which seperator we need here for the emails!!"); |
@@ -373,9 +377,9 @@ bool SharpDTMConverter::addresseeToSharp( const Addressee &addr, SlZDataBase* da | |||
373 | //qDebug("SharpDTMConverter::addresseeToSharp: may be writeField(\"ZdbAdrs::Gender\", ushort) is here better suited?"); | 377 | //qDebug("SharpDTMConverter::addresseeToSharp: may be writeField(\"ZdbAdrs::Gender\", ushort) is here better suited?"); |
374 | //qDebug("SharpDTMConverter::addresseeToSharp: check also the reverse functionality in sharpToAddressee"); | 378 | //qDebug("SharpDTMConverter::addresseeToSharp: check also the reverse functionality in sharpToAddressee"); |
375 | if (gt == "male") | 379 | if (gt == "male") |
376 | database->writeField(ZdbAdrs::Gender, "male"); | 380 | database->writeField(ZdbAdrs::Gender, "1"); |
377 | else if (gt == "female") | 381 | else if (gt == "female") |
378 | database->writeField(ZdbAdrs::Gender, "female"); | 382 | database->writeField(ZdbAdrs::Gender, "2"); |
379 | else | 383 | else |
380 | database->writeField(ZdbAdrs::Gender, ""); | 384 | database->writeField(ZdbAdrs::Gender, ""); |
381 | 385 | ||