From fbc1ca53388337b66017973896725d51416aae1a Mon Sep 17 00:00:00 2001 From: zautrix Date: Tue, 18 Jan 2005 10:15:21 +0000 Subject: fix --- diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 82b4b9b..bfcfab5 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp @@ -336,6 +336,25 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) if ( ! found ) // LR try this one... mData->phoneNumbers.append( *phoneItAD ); } + } else { + PhoneNumber::List phoneAD = ad.phoneNumbers(); + PhoneNumber::List::Iterator phoneItAD; + for ( phoneItAD = phoneAD.begin(); phoneItAD != phoneAD.end(); ++phoneItAD ) { + bool found = false; + PhoneNumber::List::Iterator it; + for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { + if ( ( *phoneItAD ).contains( (*it) ) ) { + found = true; + (*it).setType( ( *phoneItAD ).type() ); + (*it).setNumber( ( *phoneItAD ).number() ); + break; + } + } + if ( ! found ) { // append numbers which do not have work or home type + if ( ! ( ( *phoneItAD ).type() & (PhoneNumber::Work | PhoneNumber::Home) ) ) + mData->phoneNumbers.append( *phoneItAD ); + } + } } if ( isSubSet ) { // ************* emails; -- cgit v0.9.0.2