author | zautrix <zautrix> | 2004-09-18 17:25:46 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-18 17:25:46 (UTC) |
commit | 3f16c7aa0ab6badf304c537a6981ece743138821 (patch) (side-by-side diff) | |
tree | 1dda326a1025477c7dd1a284609fa108da4e2e1d /kabc | |
parent | a355a58898d0d08d797f872751254cfa958387c1 (diff) | |
download | kdepimpi-3f16c7aa0ab6badf304c537a6981ece743138821.zip kdepimpi-3f16c7aa0ab6badf304c537a6981ece743138821.tar.gz kdepimpi-3f16c7aa0ab6badf304c537a6981ece743138821.tar.bz2 |
sync fixes
-rw-r--r-- | kabc/addressbook.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index d03dea3..16e1653 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp @@ -445,27 +445,31 @@ Ticket *AddressBook::requestSaveTicket( Resource *resource ) return 0; } void AddressBook::insertAddressee( const Addressee &a, bool setRev ) { Addressee::List::Iterator it; for ( it = d->mAddressees.begin(); it != d->mAddressees.end(); ++it ) { if ( a.uid() == (*it).uid() ) { + if ( setRev && (*it).uid().left( 19 ) == QString("last-syncAddressee-") ) { + return; + } bool changed = false; Addressee addr = a; if ( addr != (*it) ) changed = true; (*it) = a; if ( (*it).resource() == 0 ) (*it).setResource( standardResource() ); if ( changed ) { if ( setRev ) { + // get rid of micro seconds QDateTime dt = QDateTime::currentDateTime(); QTime t = dt.time(); dt.setTime( QTime (t.hour (), t.minute (), t.second () ) ); (*it).setRevision( dt ); } (*it).setChanged( true ); } @@ -520,17 +524,17 @@ Addressee AddressBook::findByUid( const QString &uid ) return Addressee(); } Addressee::List AddressBook::getExternLastSyncAddressees() { Addressee::List results; Iterator it; for ( it = begin(); it != end(); ++it ) { - if ( (*it).uid().left( 20 ) == "last-syncAddressee-" ) { + if ( (*it).uid().left( 19 ) == "last-syncAddressee-" ) { if ( (*it).familyName().left(3) == "E: " ) results.append( *it ); } } return results; } void AddressBook::resetTempSyncStat() @@ -551,16 +555,17 @@ QStringList AddressBook:: uidList() } return results; } Addressee::List AddressBook::allAddressees() { return d->mAddressees; + } Addressee::List AddressBook::findByName( const QString &name ) { Addressee::List results; Iterator it; for ( it = begin(); it != end(); ++it ) { |