summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-27 10:36:51 (UTC)
committer zautrix <zautrix>2004-10-27 10:36:51 (UTC)
commitce5b6b62c92cc051c5c9e780508b6d42c46df8ed (patch) (side-by-side diff)
tree257fa9c582c6f8c0bd1948a04e8f4083862932a8
parent835411009ea43a8182b16b78c03b11616f989f50 (diff)
downloadkdepimpi-ce5b6b62c92cc051c5c9e780508b6d42c46df8ed.zip
kdepimpi-ce5b6b62c92cc051c5c9e780508b6d42c46df8ed.tar.gz
kdepimpi-ce5b6b62c92cc051c5c9e780508b6d42c46df8ed.tar.bz2
fixed remove sync info
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kabc/addressbook.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp
index 2785131..df0fba4 100644
--- a/kabc/addressbook.cpp
+++ b/kabc/addressbook.cpp
@@ -556,12 +556,33 @@ void AddressBook::smplifyAddressees()
void AddressBook::removeSyncInfo( QString syncProfile)
{
Iterator ait;
for ( ait = begin(); ait != end(); ++ait ) {
(*ait).removeID( syncProfile );
}
+ if ( syncProfile.isEmpty() ) {
+ Iterator it = begin();
+ Iterator it2 ;
+ QDateTime dt ( QDate( 2004,1,1) );
+ while ( it != end() ) {
+ if ( (*it).uid().left( 19 ) == QString("last-syncAddressee-") ) {
+ it2 = it;
+ //qDebug("removing %s ",(*it).uid().latin1() );
+ ++it;
+ removeAddressee( it2 );
+ } else {
+ //qDebug("skipping %s ",(*it).uid().latin1() );
+ ++it;
+ }
+ }
+ } else {
+ Addressee lse;
+ lse = mAddressBook->findByUid( "last-syncAddressee-"+ syncProfile );
+ if ( ! lse.isEmpty() )
+ removeAddressee( lse );
+ }
}
void AddressBook::preparePhoneSync( QString currentSyncDevice, bool isPreSync )
{
Iterator ait;
for ( ait = begin(); ait != end(); ++ait ) {