-rw-r--r-- | kabc/addressee.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 155ce24..7e1e414 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp | |||
@@ -297,25 +297,50 @@ void Addressee::computeCsum(const QString &dev) | |||
297 | } | 297 | } |
298 | uint cs = getCsum4List(l); | 298 | uint cs = getCsum4List(l); |
299 | 299 | ||
300 | #if 0 | 300 | #if 0 |
301 | for ( iii = 0; iii < l.count(); ++iii) | 301 | for ( iii = 0; iii < l.count(); ++iii) |
302 | qDebug("%d***%s***",iii,l[iii].latin1()); | 302 | qDebug("%d***%s***",iii,l[iii].latin1()); |
303 | qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() ); | 303 | qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() ); |
304 | #endif | 304 | #endif |
305 | 305 | ||
306 | 306 | ||
307 | setCsum( dev, QString::number (cs )); | 307 | setCsum( dev, QString::number (cs )); |
308 | } | 308 | } |
309 | bool Addressee::matchAddress( QRegExp* re ) const | ||
310 | { | ||
311 | KABC::Address::List::Iterator addressIter; | ||
312 | for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end(); | ||
313 | ++addressIter ) { | ||
314 | if ( (*addressIter).matchAddress( re ) ) | ||
315 | return true; | ||
316 | } | ||
317 | return false; | ||
318 | } | ||
319 | bool Addressee::matchPhoneNumber( QRegExp* re ) const | ||
320 | { | ||
321 | KABC::PhoneNumber::List::Iterator phoneIter; | ||
322 | |||
323 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); ++phoneIter ) { | ||
324 | #if QT_VERSION >= 0x030000 | ||
325 | if (re->search( (*phoneIter).number() ) == 0) | ||
326 | #else | ||
327 | if (re->match( (*phoneIter).number() ) == 0) | ||
328 | #endif | ||
329 | return true; | ||
309 | 330 | ||
331 | } | ||
332 | return false; | ||
333 | |||
334 | } | ||
310 | void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) | 335 | void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) |
311 | { | 336 | { |
312 | // merge all standard non-outlook fields. | 337 | // merge all standard non-outlook fields. |
313 | //if isSubSet (e.g. mobile phone sync) merge all fields | 338 | //if isSubSet (e.g. mobile phone sync) merge all fields |
314 | 339 | ||
315 | detach(); | 340 | detach(); |
316 | if ( isSubSet ) { | 341 | if ( isSubSet ) { |
317 | if ( mData->name.isEmpty() ) mData->name = ad.mData->name; | 342 | if ( mData->name.isEmpty() ) mData->name = ad.mData->name; |
318 | if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName; | 343 | if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName; |
319 | if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName; | 344 | if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName; |
320 | if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ; | 345 | if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ; |
321 | if ( mData->additionalName ) mData->additionalName = ad.mData->additionalName; | 346 | if ( mData->additionalName ) mData->additionalName = ad.mData->additionalName; |