-rw-r--r-- | kabc/addressee.cpp | 23 | ||||
-rw-r--r-- | kabc/plugins/sharpdtm/sharpdtmconverter.cpp | 20 |
2 files changed, 29 insertions, 14 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 3b238f5..82b4b9b 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp | |||
@@ -286,4 +286,7 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) | |||
286 | { | 286 | { |
287 | // merge all standard non-outlook fields. | ||
288 | //if isSubSet (e.g. mobile phone sync) merge all fields | ||
287 | 289 | ||
288 | detach(); | 290 | detach(); |
291 | if ( isSubSet ) { | ||
289 | if ( mData->name.isEmpty() ) mData->name = ad.mData->name; | 292 | if ( mData->name.isEmpty() ) mData->name = ad.mData->name; |
@@ -295,3 +298,9 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) | |||
295 | if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix; | 298 | if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix; |
299 | if ( mData->title .isEmpty() ) mData->title = ad.mData->title ; | ||
300 | if ( mData->role.isEmpty() ) mData->role = ad.mData->role ; | ||
296 | if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName; | 301 | if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName; |
302 | if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ; | ||
303 | if ( mData->note.isEmpty() ) mData->note = ad.mData->note ; | ||
304 | if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy; | ||
305 | if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ; | ||
297 | if ( !mData->birthday.isValid() ) | 306 | if ( !mData->birthday.isValid() ) |
@@ -299,2 +308,4 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) | |||
299 | mData->birthday = ad.mData->birthday; | 308 | mData->birthday = ad.mData->birthday; |
309 | |||
310 | } | ||
300 | if ( mData->mailer.isEmpty() ) mData->mailer = ad.mData->mailer; | 311 | if ( mData->mailer.isEmpty() ) mData->mailer = ad.mData->mailer; |
@@ -302,10 +313,4 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) | |||
302 | if ( !mData->geo.isValid() ) mData->geo = ad.mData->geo; | 313 | if ( !mData->geo.isValid() ) mData->geo = ad.mData->geo; |
303 | if ( mData->title .isEmpty() ) mData->title = ad.mData->title ; | ||
304 | if ( mData->role.isEmpty() ) mData->role = ad.mData->role ; | ||
305 | if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ; | ||
306 | if ( mData->note.isEmpty() ) mData->note = ad.mData->note ; | ||
307 | if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId; | 314 | if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId; |
308 | if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString; | 315 | if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString; |
309 | if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy; | ||
310 | if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ; | ||
311 | QStringList t; | 316 | QStringList t; |
@@ -315,2 +320,3 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) | |||
315 | // ********** phone numbers | 320 | // ********** phone numbers |
321 | if ( isSubSet ) { | ||
316 | PhoneNumber::List phoneAD = ad.phoneNumbers(); | 322 | PhoneNumber::List phoneAD = ad.phoneNumbers(); |
@@ -332,2 +338,3 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) | |||
332 | } | 338 | } |
339 | } | ||
333 | if ( isSubSet ) { | 340 | if ( isSubSet ) { |
@@ -342,2 +349,3 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) | |||
342 | // ************* categories; | 349 | // ************* categories; |
350 | if ( isSubSet ) { | ||
343 | t = mData->categories; | 351 | t = mData->categories; |
@@ -347,2 +355,3 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) | |||
347 | mData->categories.append( tAD[iii] ); | 355 | mData->categories.append( tAD[iii] ); |
356 | } | ||
348 | QStringList::ConstIterator it; | 357 | QStringList::ConstIterator it; |
@@ -391,2 +400,3 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) | |||
391 | } | 400 | } |
401 | if ( isSubSet ) { | ||
392 | KABC::Address::List::Iterator addressIterA; | 402 | KABC::Address::List::Iterator addressIterA; |
@@ -408,2 +418,3 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) | |||
408 | } | 418 | } |
419 | } | ||
409 | //qDebug("merge contact %s ", ad.uid().latin1()); | 420 | //qDebug("merge contact %s ", ad.uid().latin1()); |
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 | |||
@@ -82,3 +82,4 @@ bool SharpDTMConverter::sharpToAddressee( const CardId &contact, const SlZDataBa | |||
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 | ||
@@ -224,7 +225,8 @@ bool SharpDTMConverter::sharpToAddressee( const CardId &contact, const SlZDataBa | |||
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 | ||
@@ -236,3 +238,5 @@ bool SharpDTMConverter::sharpToAddressee( const CardId &contact, const SlZDataBa | |||
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 | ||
@@ -300,3 +304,3 @@ bool SharpDTMConverter::addresseeToSharp( const Addressee &addr, SlZDataBase* da | |||
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 | ||
@@ -375,5 +379,5 @@ bool SharpDTMConverter::addresseeToSharp( const Addressee &addr, SlZDataBase* da | |||
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 |