summaryrefslogtreecommitdiffabout
path: root/kabc/addressee.cpp
Side-by-side diff
Diffstat (limited to 'kabc/addressee.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kabc/addressee.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp
index e571980..19a1845 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp
@@ -314,8 +314,24 @@ void Addressee::mergeContact( const Addressee& ad )
setUid( ad.uid() );
setRevision( ad.revision() );
}
+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 ) {
+ removeAddress( (*it) );
+ }
+}
+
// removes all emails but the first
// needed by phone sync
void Addressee::simplifyEmails()
{