author | zautrix <zautrix> | 2004-10-08 23:38:07 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-08 23:38:07 (UTC) |
commit | 07fdef2c2ea1153d39d7114b3d5bd4abc4f4c861 (patch) (unidiff) | |
tree | 03d0e5d20e607e035e17fcdabd6bce789069f41e /kabc/addressee.cpp | |
parent | 44169895703beb3e8b1551a313d2d341bf742905 (diff) | |
download | kdepimpi-07fdef2c2ea1153d39d7114b3d5bd4abc4f4c861.zip kdepimpi-07fdef2c2ea1153d39d7114b3d5bd4abc4f4c861.tar.gz kdepimpi-07fdef2c2ea1153d39d7114b3d5bd4abc4f4c861.tar.bz2 |
some bugfixes
-rw-r--r-- | kabc/addressee.cpp | 16 |
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 | |||
@@ -306,24 +306,40 @@ void Addressee::mergeContact( const Addressee& ad ) | |||
306 | // pending: | 306 | // pending: |
307 | // merging phonenumbers | 307 | // merging phonenumbers |
308 | // merging addresses | 308 | // merging addresses |
309 | // merging emails; | 309 | // merging emails; |
310 | // merging categories; | 310 | // merging categories; |
311 | // merging custom; | 311 | // merging custom; |
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 | ||
318 | void 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 |
320 | void Addressee::simplifyEmails() | 336 | void 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(); |
324 | detach(); | 340 | detach(); |
325 | mData->emails.clear(); | 341 | mData->emails.clear(); |
326 | mData->emails.append( email ); | 342 | mData->emails.append( email ); |
327 | } | 343 | } |
328 | 344 | ||
329 | void Addressee::simplifyPhoneNumbers() | 345 | void Addressee::simplifyPhoneNumbers() |