summaryrefslogtreecommitdiffabout
path: root/kabc/addressee.cpp
Unidiff
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 )
312 // merging keys 312 // merging keys
313 qDebug("merge contact %s ", ad.uid().latin1()); 313 qDebug("merge contact %s ", ad.uid().latin1());
314 setUid( ad.uid() ); 314 setUid( ad.uid() );
315 setRevision( ad.revision() ); 315 setRevision( ad.revision() );
316} 316}
317 317
318void Addressee::simplifyAddresses()
319{
320 if ( mData->addresses.count() < 3 ) return ;
321 int count = 0;
322 Address::List list;
323 Address::List::Iterator it;
324 for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) {
325 if ( count > 1 )
326 list.append( *it );
327 ++count;
328 }
329 for( it = list.begin(); it != list.end(); ++it ) {
330 removeAddress( (*it) );
331 }
332}
333
318// removes all emails but the first 334// removes all emails but the first
319// needed by phone sync 335// needed by phone sync
320void Addressee::simplifyEmails() 336void Addressee::simplifyEmails()
321{ 337{
322 if ( mData->emails.count() == 0 ) return ; 338 if ( mData->emails.count() == 0 ) return ;
323 QString email = mData->emails.first(); 339 QString email = mData->emails.first();