summaryrefslogtreecommitdiffabout
path: root/kabc/addressee.cpp
Side-by-side diff
Diffstat (limited to 'kabc/addressee.cpp') (more/less context) (ignore 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
@@ -312,12 +312,28 @@ void Addressee::mergeContact( const Addressee& ad )
// merging keys
qDebug("merge contact %s ", ad.uid().latin1());
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()
{
if ( mData->emails.count() == 0 ) return ;
QString email = mData->emails.first();