-rw-r--r-- | kabc/addressee.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 19a1845..3f3d5c0 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp @@ -306,24 +306,41 @@ void Addressee::mergeContact( const Addressee& ad ) // pending: // merging phonenumbers // merging addresses // merging emails; // merging categories; // merging custom; // merging keys qDebug("merge contact %s ", ad.uid().latin1()); setUid( ad.uid() ); setRevision( ad.revision() ); } +bool Addressee::removeVoice() +{ + PhoneNumber::List phoneN = phoneNumbers(); + PhoneNumber::List::Iterator phoneIt; + bool found = false; + for ( phoneIt = phoneN.begin(); phoneIt != phoneN.end(); ++phoneIt ) { + if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found + if ((*phoneIt).type() - PhoneNumber::Voice ) { + (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice ); + insertPhoneNumber( (*phoneIt) ); + found = true; + } + } + + } + return found; +} void Addressee::simplifyAddresses() { if ( mData->addresses.count() < 3 ) return ; int count = 0; Address::List list; Address::List::Iterator it; for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { if ( count > 1 ) list.append( *it ); ++count; } for( it = list.begin(); it != list.end(); ++it ) { |