summaryrefslogtreecommitdiffabout
path: root/kabc/addressbook.cpp
Side-by-side diff
Diffstat (limited to 'kabc/addressbook.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kabc/addressbook.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp
index 3ec0795..d03dea3 100644
--- a/kabc/addressbook.cpp
+++ b/kabc/addressbook.cpp
@@ -447,34 +447,39 @@ Ticket *AddressBook::requestSaveTicket( Resource *resource )
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() ) {
bool changed = false;
Addressee addr = a;
if ( addr != (*it) )
changed = true;
(*it) = a;
if ( (*it).resource() == 0 )
(*it).setResource( standardResource() );
if ( changed ) {
- if ( setRev )
- (*it).setRevision( QDateTime::currentDateTime() );
+ 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 );
}
return;
}
}
d->mAddressees.append( a );
Addressee& addr = d->mAddressees.last();
if ( addr.resource() == 0 )
addr.setResource( standardResource() );
addr.setChanged( true );
}
void AddressBook::removeAddressee( const Addressee &a )
{