summaryrefslogtreecommitdiffabout
path: root/kabc
Unidiff
Diffstat (limited to 'kabc') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressee.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp
index 295ee4f..2564894 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp
@@ -258,391 +258,409 @@ void Addressee::computeCsum(const QString &dev)
258 for ( iii = 0; iii < t.count(); ++iii) 258 for ( iii = 0; iii < t.count(); ++iii)
259 l.append( t[iii] ); 259 l.append( t[iii] );
260 KABC::Address::List::Iterator addressIter; 260 KABC::Address::List::Iterator addressIter;
261 for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end(); 261 for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end();
262 ++addressIter ) { 262 ++addressIter ) {
263 t = (*addressIter).asList(); 263 t = (*addressIter).asList();
264 t.sort(); 264 t.sort();
265 for ( iii = 0; iii < t.count(); ++iii) 265 for ( iii = 0; iii < t.count(); ++iii)
266 l.append( t[iii] ); 266 l.append( t[iii] );
267 } 267 }
268 uint cs = getCsum4List(l); 268 uint cs = getCsum4List(l);
269 // qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() ); 269 // qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() );
270 setCsum( dev, QString::number (cs )); 270 setCsum( dev, QString::number (cs ));
271} 271}
272 272
273void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) 273void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false)
274{ 274{
275 275
276 detach(); 276 detach();
277 if ( mData->name.isEmpty() ) mData->name = ad.mData->name; 277 if ( mData->name.isEmpty() ) mData->name = ad.mData->name;
278 if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName; 278 if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName;
279 if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName; 279 if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName;
280 if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ; 280 if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ;
281 if ( mData->additionalName ) mData->additionalName = ad.mData->additionalName; 281 if ( mData->additionalName ) mData->additionalName = ad.mData->additionalName;
282 if ( mData->prefix.isEmpty() ) mData->prefix = ad.mData->prefix; 282 if ( mData->prefix.isEmpty() ) mData->prefix = ad.mData->prefix;
283 if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix; 283 if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix;
284 if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName; 284 if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName;
285 if ( !mData->birthday.isValid() ) 285 if ( !mData->birthday.isValid() )
286 if ( ad.mData->birthday.isValid()) 286 if ( ad.mData->birthday.isValid())
287 mData->birthday = ad.mData->birthday; 287 mData->birthday = ad.mData->birthday;
288 if ( mData->mailer.isEmpty() ) mData->mailer = ad.mData->mailer; 288 if ( mData->mailer.isEmpty() ) mData->mailer = ad.mData->mailer;
289 if ( !mData->timeZone.isValid() ) mData->timeZone = ad.mData->timeZone; 289 if ( !mData->timeZone.isValid() ) mData->timeZone = ad.mData->timeZone;
290 if ( !mData->geo.isValid() ) mData->geo = ad.mData->geo; 290 if ( !mData->geo.isValid() ) mData->geo = ad.mData->geo;
291 if ( mData->title .isEmpty() ) mData->title = ad.mData->title ; 291 if ( mData->title .isEmpty() ) mData->title = ad.mData->title ;
292 if ( mData->role.isEmpty() ) mData->role = ad.mData->role ; 292 if ( mData->role.isEmpty() ) mData->role = ad.mData->role ;
293 if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ; 293 if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ;
294 if ( mData->note.isEmpty() ) mData->note = ad.mData->note ; 294 if ( mData->note.isEmpty() ) mData->note = ad.mData->note ;
295 if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId; 295 if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId;
296 if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString; 296 if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString;
297 if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy; 297 if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy;
298 if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ; 298 if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ;
299 QStringList t; 299 QStringList t;
300 QStringList tAD; 300 QStringList tAD;
301 uint iii; 301 uint iii;
302 302
303 // ********** phone numbers 303 // ********** phone numbers
304 PhoneNumber::List phoneAD = ad.phoneNumbers(); 304 PhoneNumber::List phoneAD = ad.phoneNumbers();
305 PhoneNumber::List::Iterator phoneItAD; 305 PhoneNumber::List::Iterator phoneItAD;
306 for ( phoneItAD = phoneAD.begin(); phoneItAD != phoneAD.end(); ++phoneItAD ) { 306 for ( phoneItAD = phoneAD.begin(); phoneItAD != phoneAD.end(); ++phoneItAD ) {
307 bool found = false; 307 bool found = false;
308 PhoneNumber::List::Iterator it; 308 PhoneNumber::List::Iterator it;
309 for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { 309 for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) {
310 if ( ( *phoneItAD ).contains( (*it) ) ) { 310 if ( ( *phoneItAD ).contains( (*it) ) ) {
311 found = true; 311 found = true;
312 (*it).setType( ( *phoneItAD ).type() ); 312 (*it).setType( ( *phoneItAD ).type() );
313 break; 313 break;
314 } 314 }
315 } 315 }
316 if ( isSubSet && ! found ) 316 if ( isSubSet && ! found )
317 mData->phoneNumbers.append( *phoneItAD ); 317 mData->phoneNumbers.append( *phoneItAD );
318 } 318 }
319 if ( isSubSet ) { 319 if ( isSubSet ) {
320 // ************* emails; 320 // ************* emails;
321 t = mData->emails; 321 t = mData->emails;
322 tAD = ad.mData->emails; 322 tAD = ad.mData->emails;
323 for ( iii = 0; iii < tAD.count(); ++iii) 323 for ( iii = 0; iii < tAD.count(); ++iii)
324 if ( !t.contains(tAD[iii] ) ) 324 if ( !t.contains(tAD[iii] ) )
325 mData->emails.append( tAD[iii] ); 325 mData->emails.append( tAD[iii] );
326 } 326 }
327 327
328 // ************* categories; 328 // ************* categories;
329 t = mData->categories; 329 t = mData->categories;
330 tAD = ad.mData->categories; 330 tAD = ad.mData->categories;
331 for ( iii = 0; iii < tAD.count(); ++iii) 331 for ( iii = 0; iii < tAD.count(); ++iii)
332 if ( !t.contains(tAD[iii] ) ) 332 if ( !t.contains(tAD[iii] ) )
333 mData->categories.append( tAD[iii] ); 333 mData->categories.append( tAD[iii] );
334 QStringList::ConstIterator it; 334 QStringList::ConstIterator it;
335 for( it = ad.mData->custom.begin(); it != ad.mData->custom.end(); ++it ) { 335 for( it = ad.mData->custom.begin(); it != ad.mData->custom.end(); ++it ) {
336 QString qualifiedName = (*it).left( (*it).find( ":" )); 336 QString qualifiedName = (*it).left( (*it).find( ":" ));
337 bool found = false; 337 bool found = false;
338 QStringList::ConstIterator itL; 338 QStringList::ConstIterator itL;
339 for( itL = mData->custom.begin(); itL != mData->custom.end(); ++itL ) { 339 for( itL = mData->custom.begin(); itL != mData->custom.end(); ++itL ) {
340 if ( (*itL).startsWith( qualifiedName ) ) { 340 if ( (*itL).startsWith( qualifiedName ) ) {
341 found = true; 341 found = true;
342 break; 342 break;
343 } 343 }
344 } 344 }
345 if ( ! found ) { 345 if ( ! found ) {
346 mData->custom.append( *it ); 346 mData->custom.append( *it );
347 } 347 }
348 } 348 }
349 if ( mData->logo.undefined() && !ad.mData->logo.undefined() ) mData->logo = ad.mData->logo; 349 if ( mData->logo.undefined() && !ad.mData->logo.undefined() ) mData->logo = ad.mData->logo;
350 if ( mData->photo.undefined() && !ad.mData->photo.undefined() ) mData->photo = ad.mData->photo; 350 if ( mData->photo.undefined() && !ad.mData->photo.undefined() ) mData->photo = ad.mData->photo;
351 if ( !mData->sound.isIntern() ) { 351 if ( !mData->sound.isIntern() ) {
352 if ( mData->sound.url().isEmpty() ) { 352 if ( mData->sound.url().isEmpty() ) {
353 mData->sound = ad.mData->sound; 353 mData->sound = ad.mData->sound;
354 } 354 }
355 } 355 }
356 if ( !mData->agent.isIntern() ) { 356 if ( !mData->agent.isIntern() ) {
357 if ( mData->agent.url().isEmpty() ) { 357 if ( mData->agent.url().isEmpty() ) {
358 mData->agent = ad.mData->agent; 358 mData->agent = ad.mData->agent;
359 } 359 }
360 } 360 }
361 { 361 {
362 Key::List::Iterator itA; 362 Key::List::Iterator itA;
363 for( itA = ad.mData->keys.begin(); itA != ad.mData->keys.end(); ++itA ) { 363 for( itA = ad.mData->keys.begin(); itA != ad.mData->keys.end(); ++itA ) {
364 bool found = false; 364 bool found = false;
365 Key::List::Iterator it; 365 Key::List::Iterator it;
366 for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) { 366 for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) {
367 if ( (*it) == (*itA)) { 367 if ( (*it) == (*itA)) {
368 found = true; 368 found = true;
369 break; 369 break;
370 370
371 } 371 }
372 } 372 }
373 if ( ! found ) { 373 if ( ! found ) {
374 mData->keys.append( *itA ); 374 mData->keys.append( *itA );
375 } 375 }
376 } 376 }
377 } 377 }
378 KABC::Address::List::Iterator addressIterA; 378 KABC::Address::List::Iterator addressIterA;
379 for ( addressIterA = ad.mData->addresses.begin(); addressIterA != ad.mData->addresses.end(); ++addressIterA ) { 379 for ( addressIterA = ad.mData->addresses.begin(); addressIterA != ad.mData->addresses.end(); ++addressIterA ) {
380 bool found = false; 380 bool found = false;
381 KABC::Address::List::Iterator addressIter; 381 KABC::Address::List::Iterator addressIter;
382 for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end(); 382 for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end();
383 ++addressIter ) { 383 ++addressIter ) {
384 if ( (*addressIter) == (*addressIterA)) { 384 if ( (*addressIter) == (*addressIterA)) {
385 found = true; 385 found = true;
386 (*addressIter).setType( (*addressIterA).type() ); 386 (*addressIter).setType( (*addressIterA).type() );
387 break; 387 break;
388 } 388 }
389 389
390 } 390 }
391 if ( isSubSet && ! found ) { 391 if ( isSubSet && ! found ) {
392 mData->addresses.append( *addressIterA ); 392 mData->addresses.append( *addressIterA );
393 } 393 }
394 } 394 }
395 //qDebug("merge contact %s ", ad.uid().latin1()); 395 //qDebug("merge contact %s ", ad.uid().latin1());
396 setUid( ad.uid() ); 396 setUid( ad.uid() );
397 setRevision( ad.revision() ); 397 setRevision( ad.revision() );
398} 398}
399 399
400bool Addressee::removeVoice() 400bool Addressee::removeVoice()
401{ 401{
402 PhoneNumber::List phoneN = phoneNumbers(); 402 PhoneNumber::List phoneN = phoneNumbers();
403 PhoneNumber::List::Iterator phoneIt; 403 PhoneNumber::List::Iterator phoneIt;
404 bool found = false; 404 bool found = false;
405 for ( phoneIt = phoneN.begin(); phoneIt != phoneN.end(); ++phoneIt ) { 405 for ( phoneIt = phoneN.begin(); phoneIt != phoneN.end(); ++phoneIt ) {
406 if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found 406 if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found
407 if ((*phoneIt).type() - PhoneNumber::Voice ) { 407 if ((*phoneIt).type() - PhoneNumber::Voice ) {
408 (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice ); 408 (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice );
409 insertPhoneNumber( (*phoneIt) ); 409 insertPhoneNumber( (*phoneIt) );
410 found = true; 410 found = true;
411 } 411 }
412 } 412 }
413 413
414 } 414 }
415 return found; 415 return found;
416} 416}
417 417
418bool Addressee::containsAdr(const Addressee& ad ) 418bool Addressee::containsAdr(const Addressee& ad )
419{ 419{
420 if ( ! ad.mData->familyName.isEmpty() ) if ( mData->familyName != ad.mData->familyName) return false; 420 if ( ! ad.mData->familyName.isEmpty() ) if ( mData->familyName != ad.mData->familyName) return false;
421 if ( ! ad.mData->givenName.isEmpty() )if ( mData->givenName != ad.mData->givenName ) return false; 421 if ( ! ad.mData->givenName.isEmpty() )if ( mData->givenName != ad.mData->givenName ) return false;
422 if ( ad.mData->url.isValid() ) if (mData->url != ad.mData->url) return false ; 422 if ( ad.mData->url.isValid() ) if (mData->url != ad.mData->url) return false ;
423 if ( ! ad.mData->role.isEmpty() ) if (mData->role != ad.mData->role) return false ; 423 if ( ! ad.mData->role.isEmpty() ) if (mData->role != ad.mData->role) return false ;
424 if ( ! ad.mData->organization.isEmpty() ) if (mData->organization != ad.mData->organization) return false ; 424 if ( ! ad.mData->organization.isEmpty() ) if (mData->organization != ad.mData->organization) return false ;
425 if ( ! ad.mData->note.isEmpty() ) if (mData->note != ad.mData->note) return false ; 425 if ( ! ad.mData->note.isEmpty() ) if (mData->note != ad.mData->note) return false ;
426 if ( ! ad.mData->title .isEmpty() ) if (mData->title != ad.mData->title ) return false ; 426 if ( ! ad.mData->title .isEmpty() ) if (mData->title != ad.mData->title ) return false ;
427 427
428 // compare phone numbers 428 // compare phone numbers
429 PhoneNumber::List phoneN = ad.phoneNumbers(); 429 PhoneNumber::List phoneN = ad.phoneNumbers();
430 PhoneNumber::List::Iterator phoneIt; 430 PhoneNumber::List::Iterator phoneIt;
431 bool found = false; 431 bool found = false;
432 for ( phoneIt = phoneN.begin(); phoneIt != phoneN.end(); ++phoneIt ) { 432 for ( phoneIt = phoneN.begin(); phoneIt != phoneN.end(); ++phoneIt ) {
433 bool found = false; 433 bool found = false;
434 PhoneNumber::List phoneL = ad.phoneNumbers(); 434 PhoneNumber::List phoneL = ad.phoneNumbers();
435 PhoneNumber::List::Iterator phoneItL; 435 PhoneNumber::List::Iterator phoneItL;
436 for ( phoneItL = phoneL.begin(); phoneItL != phoneL.end(); ++phoneItL ) { 436 for ( phoneItL = phoneL.begin(); phoneItL != phoneL.end(); ++phoneItL ) {
437 if ( ( *phoneItL ).number() == ( *phoneIt ).number() ) { 437 if ( ( *phoneItL ).number() == ( *phoneIt ).number() ) {
438 found = true; 438 found = true;
439 break; 439 break;
440 } 440 }
441 } 441 }
442 if ( ! found ) 442 if ( ! found )
443 return false; 443 return false;
444 } 444 }
445 return true; 445 return true;
446 446
447} 447}
448void Addressee::simplifyAddresses() 448void Addressee::simplifyAddresses()
449{ 449{
450
451
452 Address::List list;
453 Address::List::Iterator it;
454 Address::List::Iterator it2;
455 for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) {
456 it2 = it;
457 ++it2;
458 for( ; it2 != mData->addresses.end(); ++it2 ) {
459 if ( (*it) == (*it2) ) {
460 list.append( *it );
461 break;
462 }
463 }
464 }
465 for( it = list.begin(); it != list.end(); ++it ) {
466 removeAddress( (*it) );
467 }
468
469 list.clear();
450 int max = 2; 470 int max = 2;
451 if ( mData->url.isValid() ) 471 if ( mData->url.isValid() )
452 max = 1; 472 max = 1;
453 if ( mData->addresses.count() <= max ) return ; 473 if ( mData->addresses.count() <= max ) return ;
454 int count = 0; 474 int count = 0;
455 Address::List list;
456 Address::List::Iterator it;
457 for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { 475 for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) {
458 if ( count >= max ) 476 if ( count >= max )
459 list.append( *it ); 477 list.append( *it );
460 ++count; 478 ++count;
461 } 479 }
462 for( it = list.begin(); it != list.end(); ++it ) { 480 for( it = list.begin(); it != list.end(); ++it ) {
463 removeAddress( (*it) ); 481 removeAddress( (*it) );
464 } 482 }
465} 483}
466 484
467// removes all emails but the first 485// removes all emails but the first
468// needed by phone sync 486// needed by phone sync
469void Addressee::simplifyEmails() 487void Addressee::simplifyEmails()
470{ 488{
471 if ( mData->emails.count() == 0 ) return ; 489 if ( mData->emails.count() == 0 ) return ;
472 QString email = mData->emails.first(); 490 QString email = mData->emails.first();
473 detach(); 491 detach();
474 mData->emails.clear(); 492 mData->emails.clear();
475 mData->emails.append( email ); 493 mData->emails.append( email );
476} 494}
477 495
478void Addressee::simplifyPhoneNumbers() 496void Addressee::simplifyPhoneNumbers()
479{ 497{
480 int max = 4; 498 int max = 4;
481 int inList = mData->phoneNumbers.count(); 499 int inList = mData->phoneNumbers.count();
482 KABC::PhoneNumber::List removeNumbers; 500 KABC::PhoneNumber::List removeNumbers;
483 KABC::PhoneNumber::List::Iterator phoneIter; 501 KABC::PhoneNumber::List::Iterator phoneIter;
484 if ( inList > max ) { 502 if ( inList > max ) {
485 // delete non-preferred numbers 503 // delete non-preferred numbers
486 for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); 504 for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end();
487 ++phoneIter ) { 505 ++phoneIter ) {
488 if ( inList > max ) { 506 if ( inList > max ) {
489 if ( ! (( *phoneIter ).type() & PhoneNumber::Pref )) { 507 if ( ! (( *phoneIter ).type() & PhoneNumber::Pref )) {
490 removeNumbers.append( ( *phoneIter ) ); 508 removeNumbers.append( ( *phoneIter ) );
491 --inList; 509 --inList;
492 } 510 }
493 } else 511 } else
494 break; 512 break;
495 } 513 }
496 for ( phoneIter = removeNumbers.begin(); phoneIter != removeNumbers.end(); 514 for ( phoneIter = removeNumbers.begin(); phoneIter != removeNumbers.end();
497 ++phoneIter ) { 515 ++phoneIter ) {
498 removePhoneNumber(( *phoneIter )); 516 removePhoneNumber(( *phoneIter ));
499 } 517 }
500 // delete preferred numbers 518 // delete preferred numbers
501 if ( inList > max ) { 519 if ( inList > max ) {
502 for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); 520 for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end();
503 ++phoneIter ) { 521 ++phoneIter ) {
504 if ( inList > max ) { 522 if ( inList > max ) {
505 removeNumbers.append( ( *phoneIter ) ); 523 removeNumbers.append( ( *phoneIter ) );
506 --inList; 524 --inList;
507 } else 525 } else
508 break; 526 break;
509 } 527 }
510 for ( phoneIter = removeNumbers.begin(); phoneIter != removeNumbers.end(); 528 for ( phoneIter = removeNumbers.begin(); phoneIter != removeNumbers.end();
511 ++phoneIter ) { 529 ++phoneIter ) {
512 removePhoneNumber(( *phoneIter )); 530 removePhoneNumber(( *phoneIter ));
513 } 531 }
514 } 532 }
515 } 533 }
516 // remove non-numeric characters 534 // remove non-numeric characters
517 for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); 535 for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end();
518 ++phoneIter ) { 536 ++phoneIter ) {
519 if ( ! ( *phoneIter ).simplifyNumber() ) 537 if ( ! ( *phoneIter ).simplifyNumber() )
520 removeNumbers.append( ( *phoneIter ) ); 538 removeNumbers.append( ( *phoneIter ) );
521 } 539 }
522 for ( phoneIter = removeNumbers.begin(); phoneIter != removeNumbers.end(); 540 for ( phoneIter = removeNumbers.begin(); phoneIter != removeNumbers.end();
523 ++phoneIter ) { 541 ++phoneIter ) {
524 removePhoneNumber(( *phoneIter )); 542 removePhoneNumber(( *phoneIter ));
525 } 543 }
526} 544}
527void Addressee::simplifyPhoneNumberTypes() 545void Addressee::simplifyPhoneNumberTypes()
528{ 546{
529 KABC::PhoneNumber::List::Iterator phoneIter; 547 KABC::PhoneNumber::List::Iterator phoneIter;
530 for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); 548 for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end();
531 ++phoneIter ) 549 ++phoneIter )
532 ( *phoneIter ).simplifyType(); 550 ( *phoneIter ).simplifyType();
533} 551}
534void Addressee::removeID(const QString &prof) 552void Addressee::removeID(const QString &prof)
535{ 553{
536 detach(); 554 detach();
537 mData->mExternalId = KIdManager::removeId ( mData->mExternalId, prof); 555 mData->mExternalId = KIdManager::removeId ( mData->mExternalId, prof);
538 556
539} 557}
540void Addressee::setID( const QString & prof , const QString & id ) 558void Addressee::setID( const QString & prof , const QString & id )
541{ 559{
542 detach(); 560 detach();
543 mData->mExternalId = KIdManager::setId ( mData->mExternalId, prof, id ); 561 mData->mExternalId = KIdManager::setId ( mData->mExternalId, prof, id );
544 //qDebug("setID2 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); 562 //qDebug("setID2 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() );
545} 563}
546void Addressee::setTempSyncStat( int id ) 564void Addressee::setTempSyncStat( int id )
547{ 565{
548 if ( mData->mTempSyncStat == id ) return; 566 if ( mData->mTempSyncStat == id ) return;
549 detach(); 567 detach();
550 mData->mTempSyncStat = id; 568 mData->mTempSyncStat = id;
551} 569}
552int Addressee::tempSyncStat() const 570int Addressee::tempSyncStat() const
553{ 571{
554 return mData->mTempSyncStat; 572 return mData->mTempSyncStat;
555} 573}
556 574
557QString Addressee::getID( const QString & prof) 575QString Addressee::getID( const QString & prof)
558{ 576{
559 return KIdManager::getId ( mData->mExternalId, prof ); 577 return KIdManager::getId ( mData->mExternalId, prof );
560} 578}
561 579
562void Addressee::setCsum( const QString & prof , const QString & id ) 580void Addressee::setCsum( const QString & prof , const QString & id )
563{ 581{
564 detach(); 582 detach();
565 //qDebug("setcsum1 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); 583 //qDebug("setcsum1 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() );
566 mData->mExternalId = KIdManager::setCsum ( mData->mExternalId, prof, id ); 584 mData->mExternalId = KIdManager::setCsum ( mData->mExternalId, prof, id );
567 //qDebug("setcsum2 %s ",mData->mExternalId.latin1() ); 585 //qDebug("setcsum2 %s ",mData->mExternalId.latin1() );
568} 586}
569 587
570QString Addressee::getCsum( const QString & prof) 588QString Addressee::getCsum( const QString & prof)
571{ 589{
572 return KIdManager::getCsum ( mData->mExternalId, prof ); 590 return KIdManager::getCsum ( mData->mExternalId, prof );
573} 591}
574 592
575void Addressee::setIDStr( const QString & s ) 593void Addressee::setIDStr( const QString & s )
576{ 594{
577 detach(); 595 detach();
578 mData->mExternalId = s; 596 mData->mExternalId = s;
579} 597}
580 598
581QString Addressee::IDStr() const 599QString Addressee::IDStr() const
582{ 600{
583 return mData->mExternalId; 601 return mData->mExternalId;
584} 602}
585 603
586void Addressee::setExternalUID( const QString &id ) 604void Addressee::setExternalUID( const QString &id )
587{ 605{
588 if ( id == mData->externalUID ) return; 606 if ( id == mData->externalUID ) return;
589 detach(); 607 detach();
590 mData->empty = false; 608 mData->empty = false;
591 mData->externalUID = id; 609 mData->externalUID = id;
592} 610}
593 611
594QString Addressee::externalUID() const 612QString Addressee::externalUID() const
595{ 613{
596 return mData->externalUID; 614 return mData->externalUID;
597} 615}
598void Addressee::setOriginalExternalUID( const QString &id ) 616void Addressee::setOriginalExternalUID( const QString &id )
599{ 617{
600 if ( id == mData->originalExternalUID ) return; 618 if ( id == mData->originalExternalUID ) return;
601 detach(); 619 detach();
602 mData->empty = false; 620 mData->empty = false;
603 //qDebug("*******Set orig uid %s ", id.latin1()); 621 //qDebug("*******Set orig uid %s ", id.latin1());
604 mData->originalExternalUID = id; 622 mData->originalExternalUID = id;
605} 623}
606 624
607QString Addressee::originalExternalUID() const 625QString Addressee::originalExternalUID() const
608{ 626{
609 return mData->originalExternalUID; 627 return mData->originalExternalUID;
610} 628}
611 629
612void Addressee::setUid( const QString &id ) 630void Addressee::setUid( const QString &id )
613{ 631{
614 if ( id == mData->uid ) return; 632 if ( id == mData->uid ) return;
615 detach(); 633 detach();
616 //qDebug("****setuid %s ", id.latin1()); 634 //qDebug("****setuid %s ", id.latin1());
617 mData->empty = false; 635 mData->empty = false;
618 mData->uid = id; 636 mData->uid = id;
619} 637}
620 638
621QString Addressee::uid() const 639QString Addressee::uid() const
622{ 640{
623 if ( mData->uid.isEmpty() ) 641 if ( mData->uid.isEmpty() )
624 mData->uid = KApplication::randomString( 10 ); 642 mData->uid = KApplication::randomString( 10 );
625 643
626 return mData->uid; 644 return mData->uid;
627} 645}
628 646
629QString Addressee::uidLabel() 647QString Addressee::uidLabel()
630{ 648{
631 return i18n("Unique Identifier"); 649 return i18n("Unique Identifier");
632} 650}
633 651
634void Addressee::setName( const QString &name ) 652void Addressee::setName( const QString &name )
635{ 653{
636 if ( name == mData->name ) return; 654 if ( name == mData->name ) return;
637 detach(); 655 detach();
638 mData->empty = false; 656 mData->empty = false;
639 mData->name = name; 657 mData->name = name;
640} 658}
641 659
642QString Addressee::name() const 660QString Addressee::name() const
643{ 661{
644 return mData->name; 662 return mData->name;
645} 663}
646 664
647QString Addressee::nameLabel() 665QString Addressee::nameLabel()
648{ 666{