summaryrefslogtreecommitdiffabout
path: root/kabc/addressee.cpp
Unidiff
Diffstat (limited to 'kabc/addressee.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressee.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp
index e8e440c..9994e29 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp
@@ -346,97 +346,97 @@ void Addressee::mergeOLContact( const Addressee& ad )
346 mData->sound = ad.mData->sound; 346 mData->sound = ad.mData->sound;
347 } 347 }
348 } 348 }
349 if ( !mData->agent.isIntern() ) { 349 if ( !mData->agent.isIntern() ) {
350 if ( mData->agent.url().isEmpty() ) { 350 if ( mData->agent.url().isEmpty() ) {
351 mData->agent = ad.mData->agent; 351 mData->agent = ad.mData->agent;
352 } 352 }
353 } 353 }
354 { 354 {
355 Key::List::Iterator itA; 355 Key::List::Iterator itA;
356 for( itA = ad.mData->keys.begin(); itA != ad.mData->keys.end(); ++itA ) { 356 for( itA = ad.mData->keys.begin(); itA != ad.mData->keys.end(); ++itA ) {
357 bool found = false; 357 bool found = false;
358 Key::List::Iterator it; 358 Key::List::Iterator it;
359 for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) { 359 for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) {
360 if ( (*it) == (*itA)) { 360 if ( (*it) == (*itA)) {
361 found = true; 361 found = true;
362 break; 362 break;
363 363
364 } 364 }
365 } 365 }
366 if ( ! found ) { 366 if ( ! found ) {
367 mData->keys.append( *itA ); 367 mData->keys.append( *itA );
368 } 368 }
369 } 369 }
370 } 370 }
371 371
372 KABC::Address addthis = otherAddress(); 372 KABC::Address addthis = otherAddress();
373 KABC::Address addother = ad.otherAddress(); 373 KABC::Address addother = ad.otherAddress();
374 if ( !addthis.isEmpty() && !addother.isEmpty() ) 374 if ( !addthis.isEmpty() && !addother.isEmpty() )
375 addthis.setType( addother.type() ); 375 addthis.setType( addother.type() );
376 //qDebug("merge contact %s ", ad.uid().latin1()); 376 //qDebug("merge contact %s ", ad.uid().latin1());
377 setUid( ad.uid() ); 377 setUid( ad.uid() );
378 setRevision( ad.revision() ); 378 setRevision( ad.revision() );
379 379
380 380
381} 381}
382 382
383void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) 383void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false)
384{ 384{
385 // merge all standard non-outlook fields. 385 // merge all standard non-outlook fields.
386 //if isSubSet (e.g. mobile phone sync) merge all fields 386 //if isSubSet (e.g. mobile phone sync) merge all fields
387 387
388 detach(); 388 detach();
389 if ( isSubSet ) { 389 if ( isSubSet ) {
390 if ( mData->name.isEmpty() ) mData->name = ad.mData->name; 390 if ( mData->name.isEmpty() ) mData->name = ad.mData->name;
391 if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName; 391 if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName;
392 if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName; 392 if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName;
393 if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ; 393 if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ;
394 if ( mData->additionalName ) mData->additionalName = ad.mData->additionalName; 394 if ( mData->additionalName.isEmpty() ) mData->additionalName = ad.mData->additionalName;
395 if ( mData->prefix.isEmpty() ) mData->prefix = ad.mData->prefix; 395 if ( mData->prefix.isEmpty() ) mData->prefix = ad.mData->prefix;
396 if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix; 396 if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix;
397 if ( mData->title .isEmpty() ) mData->title = ad.mData->title ; 397 if ( mData->title .isEmpty() ) mData->title = ad.mData->title ;
398 if ( mData->role.isEmpty() ) mData->role = ad.mData->role ; 398 if ( mData->role.isEmpty() ) mData->role = ad.mData->role ;
399 if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName; 399 if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName;
400 if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ; 400 if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ;
401 if ( mData->note.isEmpty() ) mData->note = ad.mData->note ; 401 if ( mData->note.isEmpty() ) mData->note = ad.mData->note ;
402 if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy; 402 if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy;
403 if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ; 403 if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ;
404 if ( !mData->birthday.isValid() ) 404 if ( !mData->birthday.isValid() )
405 if ( ad.mData->birthday.isValid()) 405 if ( ad.mData->birthday.isValid())
406 mData->birthday = ad.mData->birthday; 406 mData->birthday = ad.mData->birthday;
407 407
408 } 408 }
409 if ( mData->mailer.isEmpty() ) mData->mailer = ad.mData->mailer; 409 if ( mData->mailer.isEmpty() ) mData->mailer = ad.mData->mailer;
410 if ( !mData->timeZone.isValid() ) mData->timeZone = ad.mData->timeZone; 410 if ( !mData->timeZone.isValid() ) mData->timeZone = ad.mData->timeZone;
411 if ( !mData->geo.isValid() ) mData->geo = ad.mData->geo; 411 if ( !mData->geo.isValid() ) mData->geo = ad.mData->geo;
412 if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId; 412 if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId;
413 if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString; 413 if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString;
414 QStringList t; 414 QStringList t;
415 QStringList tAD; 415 QStringList tAD;
416 uint iii; 416 uint iii;
417 417
418 // ********** phone numbers 418 // ********** phone numbers
419 if ( isSubSet ) { 419 if ( isSubSet ) {
420 PhoneNumber::List phoneAD = ad.phoneNumbers(); 420 PhoneNumber::List phoneAD = ad.phoneNumbers();
421 PhoneNumber::List::Iterator phoneItAD; 421 PhoneNumber::List::Iterator phoneItAD;
422 for ( phoneItAD = phoneAD.begin(); phoneItAD != phoneAD.end(); ++phoneItAD ) { 422 for ( phoneItAD = phoneAD.begin(); phoneItAD != phoneAD.end(); ++phoneItAD ) {
423 bool found = false; 423 bool found = false;
424 PhoneNumber::List::Iterator it; 424 PhoneNumber::List::Iterator it;
425 for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { 425 for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) {
426 if ( ( *phoneItAD ).contains( (*it) ) ) { 426 if ( ( *phoneItAD ).contains( (*it) ) ) {
427 found = true; 427 found = true;
428 (*it).setType( ( *phoneItAD ).type() ); 428 (*it).setType( ( *phoneItAD ).type() );
429 (*it).setNumber( ( *phoneItAD ).number() ); 429 (*it).setNumber( ( *phoneItAD ).number() );
430 break; 430 break;
431 } 431 }
432 } 432 }
433 // if ( isSubSet && ! found ) 433 // if ( isSubSet && ! found )
434 if ( ! found ) // LR try this one... 434 if ( ! found ) // LR try this one...
435 mData->phoneNumbers.append( *phoneItAD ); 435 mData->phoneNumbers.append( *phoneItAD );
436 } 436 }
437 } else { 437 } else {
438 PhoneNumber::List phoneAD = ad.phoneNumbers(); 438 PhoneNumber::List phoneAD = ad.phoneNumbers();
439 PhoneNumber::List::Iterator phoneItAD; 439 PhoneNumber::List::Iterator phoneItAD;
440 for ( phoneItAD = phoneAD.begin(); phoneItAD != phoneAD.end(); ++phoneItAD ) { 440 for ( phoneItAD = phoneAD.begin(); phoneItAD != phoneAD.end(); ++phoneItAD ) {
441 bool found = false; 441 bool found = false;
442 PhoneNumber::List::Iterator it; 442 PhoneNumber::List::Iterator it;