summaryrefslogtreecommitdiffabout
path: root/kabc/addressee.cpp
authorzautrix <zautrix>2004-10-14 07:24:50 (UTC)
committer zautrix <zautrix>2004-10-14 07:24:50 (UTC)
commit57bd80b04dddd40a897dce8b6902d1046d71c631 (patch) (unidiff)
treec51cb1985344173951109f4bffb12bb6a68ea7f7 /kabc/addressee.cpp
parenta6dff815a9c6d3a91094573d23c28a8553fc7cc2 (diff)
downloadkdepimpi-57bd80b04dddd40a897dce8b6902d1046d71c631.zip
kdepimpi-57bd80b04dddd40a897dce8b6902d1046d71c631.tar.gz
kdepimpi-57bd80b04dddd40a897dce8b6902d1046d71c631.tar.bz2
phone fixes
Diffstat (limited to 'kabc/addressee.cpp') (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
@@ -447,13 +447,31 @@ bool Addressee::containsAdr(const Addressee& ad )
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 );