From ce5b6b62c92cc051c5c9e780508b6d42c46df8ed Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 27 Oct 2004 10:36:51 +0000 Subject: fixed remove sync info --- (limited to 'kabc/addressbook.cpp') diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index 2785131..df0fba4 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp @@ -558,6 +558,27 @@ 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 ); } } -- cgit v0.9.0.2