author | zautrix <zautrix> | 2004-09-18 14:22:10 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-18 14:22:10 (UTC) |
commit | ca8fcf3fd4dc068747d8f31e2189145b22853d55 (patch) (unidiff) | |
tree | 29417ffd55d1c4186922a64ed0cdf1c6a1cc69a3 /kabc | |
parent | bb16660f29fc709791aa0ee4cb63a40710a994a8 (diff) | |
download | kdepimpi-ca8fcf3fd4dc068747d8f31e2189145b22853d55.zip kdepimpi-ca8fcf3fd4dc068747d8f31e2189145b22853d55.tar.gz kdepimpi-ca8fcf3fd4dc068747d8f31e2189145b22853d55.tar.bz2 |
more AB sync
-rw-r--r-- | kabc/addressbook.cpp | 15 | ||||
-rw-r--r-- | kabc/addressbook.h | 3 |
2 files changed, 13 insertions, 5 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index 9332e21..6e8d027 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp | |||
@@ -508,57 +508,64 @@ Addressee AddressBook::findByUid( const QString &uid ) | |||
508 | Iterator it; | 508 | Iterator it; |
509 | for ( it = begin(); it != end(); ++it ) { | 509 | for ( it = begin(); it != end(); ++it ) { |
510 | if ( uid == (*it).uid() ) { | 510 | if ( uid == (*it).uid() ) { |
511 | return *it; | 511 | return *it; |
512 | } | 512 | } |
513 | } | 513 | } |
514 | return Addressee(); | 514 | return Addressee(); |
515 | } | 515 | } |
516 | Addressee::List AddressBook::getExternLastSyncAddressees() | 516 | Addressee::List AddressBook::getExternLastSyncAddressees() |
517 | { | 517 | { |
518 | Addressee::List results; | 518 | Addressee::List results; |
519 | 519 | ||
520 | Iterator it; | 520 | Iterator it; |
521 | for ( it = begin(); it != end(); ++it ) { | 521 | for ( it = begin(); it != end(); ++it ) { |
522 | if ( (*it).uid().left( 20 ) == "last-syncAddressee-" ) { | 522 | if ( (*it).uid().left( 20 ) == "last-syncAddressee-" ) { |
523 | if ( (*it).familyName().left(3) == "E: " ) | 523 | if ( (*it).familyName().left(3) == "E: " ) |
524 | results.append( *it ); | 524 | results.append( *it ); |
525 | } | 525 | } |
526 | } | 526 | } |
527 | 527 | ||
528 | return results; | 528 | return results; |
529 | } | 529 | } |
530 | void AddressBook::resetTempSyncStat() | 530 | void AddressBook::resetTempSyncStat() |
531 | { | 531 | { |
532 | 532 | Iterator it; | |
533 | |||
534 | Iterator it; | ||
535 | for ( it = begin(); it != end(); ++it ) { | 533 | for ( it = begin(); it != end(); ++it ) { |
536 | (*it).setTempSyncStat ( SYNC_TEMPSTATE_INITIAL ); | 534 | (*it).setTempSyncStat ( SYNC_TEMPSTATE_INITIAL ); |
537 | } | 535 | } |
538 | 536 | ||
539 | } | 537 | } |
540 | 538 | ||
539 | QStringList AddressBook:: uidList() | ||
540 | { | ||
541 | QStringList results; | ||
542 | Iterator it; | ||
543 | for ( it = begin(); it != end(); ++it ) { | ||
544 | results.append( (*it).uid() ); | ||
545 | } | ||
546 | return results; | ||
547 | } | ||
541 | 548 | ||
542 | 549 | ||
543 | Addressee::List AddressBook::allAddressees() | 550 | Addressee::List AddressBook::allAddressees() |
544 | { | 551 | { |
545 | return d->mAddressees; | 552 | return d->mAddressees; |
546 | } | 553 | } |
547 | 554 | ||
548 | Addressee::List AddressBook::findByName( const QString &name ) | 555 | Addressee::List AddressBook::findByName( const QString &name ) |
549 | { | 556 | { |
550 | Addressee::List results; | 557 | Addressee::List results; |
551 | 558 | ||
552 | Iterator it; | 559 | Iterator it; |
553 | for ( it = begin(); it != end(); ++it ) { | 560 | for ( it = begin(); it != end(); ++it ) { |
554 | if ( name == (*it).realName() ) { | 561 | if ( name == (*it).realName() ) { |
555 | results.append( *it ); | 562 | results.append( *it ); |
556 | } | 563 | } |
557 | } | 564 | } |
558 | 565 | ||
559 | return results; | 566 | return results; |
560 | } | 567 | } |
561 | 568 | ||
562 | Addressee::List AddressBook::findByEmail( const QString &email ) | 569 | Addressee::List AddressBook::findByEmail( const QString &email ) |
563 | { | 570 | { |
564 | Addressee::List results; | 571 | Addressee::List results; |
diff --git a/kabc/addressbook.h b/kabc/addressbook.h index 05225f9..650a638 100644 --- a/kabc/addressbook.h +++ b/kabc/addressbook.h | |||
@@ -269,49 +269,50 @@ class AddressBook : public QObject | |||
269 | 269 | ||
270 | /** | 270 | /** |
271 | Return pointer list of all resources. | 271 | Return pointer list of all resources. |
272 | */ | 272 | */ |
273 | QPtrList<Resource> resources(); | 273 | QPtrList<Resource> resources(); |
274 | 274 | ||
275 | /** | 275 | /** |
276 | Set the @p ErrorHandler, that is used by @ref error() to | 276 | Set the @p ErrorHandler, that is used by @ref error() to |
277 | provide gui-independend error messages. | 277 | provide gui-independend error messages. |
278 | */ | 278 | */ |
279 | void setErrorHandler( ErrorHandler * ); | 279 | void setErrorHandler( ErrorHandler * ); |
280 | 280 | ||
281 | /** | 281 | /** |
282 | Shows gui independend error messages. | 282 | Shows gui independend error messages. |
283 | */ | 283 | */ |
284 | void error( const QString& ); | 284 | void error( const QString& ); |
285 | 285 | ||
286 | /** | 286 | /** |
287 | Query all resources to clean up their lock files | 287 | Query all resources to clean up their lock files |
288 | */ | 288 | */ |
289 | void cleanUp(); | 289 | void cleanUp(); |
290 | 290 | ||
291 | // sync stuff | 291 | // sync stuff |
292 | Addressee::List getExternLastSyncAddressees(); | 292 | Addressee::List getExternLastSyncAddressees(); |
293 | void resetTempSyncStat(); | 293 | void resetTempSyncStat(); |
294 | QStringList uidList(); | ||
294 | 295 | ||
295 | 296 | ||
296 | signals: | 297 | signals: |
297 | /** | 298 | /** |
298 | Emitted, when the address book has changed on disk. | 299 | Emitted, when the address book has changed on disk. |
299 | */ | 300 | */ |
300 | void addressBookChanged( AddressBook * ); | 301 | void addressBookChanged( AddressBook * ); |
301 | 302 | ||
302 | /** | 303 | /** |
303 | Emitted, when the address book has been locked for writing. | 304 | Emitted, when the address book has been locked for writing. |
304 | */ | 305 | */ |
305 | void addressBookLocked( AddressBook * ); | 306 | void addressBookLocked( AddressBook * ); |
306 | 307 | ||
307 | /** | 308 | /** |
308 | Emitted, when the address book has been unlocked. | 309 | Emitted, when the address book has been unlocked. |
309 | */ | 310 | */ |
310 | void addressBookUnlocked( AddressBook * ); | 311 | void addressBookUnlocked( AddressBook * ); |
311 | 312 | ||
312 | protected: | 313 | protected: |
313 | void deleteRemovedAddressees(); | 314 | void deleteRemovedAddressees(); |
314 | void setStandardResource( Resource * ); | 315 | void setStandardResource( Resource * ); |
315 | Resource *standardResource(); | 316 | Resource *standardResource(); |
316 | KRES::Manager<Resource> *resourceManager(); | 317 | KRES::Manager<Resource> *resourceManager(); |
317 | 318 | ||