-rw-r--r-- | kabc/addressbook.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index d03dea3..16e1653 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp @@ -449,8 +449,11 @@ 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; @@ -460,8 +463,9 @@ void AddressBook::insertAddressee( const Addressee &a, bool setRev ) (*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 () ) ); @@ -524,9 +528,9 @@ 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 ); } } @@ -554,9 +558,10 @@ QStringList AddressBook:: uidList() Addressee::List AddressBook::allAddressees() { - return d->mAddressees; + return d->mAddressees; + } Addressee::List AddressBook::findByName( const QString &name ) { |