author | zautrix <zautrix> | 2004-10-09 17:36:32 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-09 17:36:32 (UTC) |
commit | d68435216e1ebc5a7fed391157197994e13992b3 (patch) (side-by-side diff) | |
tree | 3cb23a2cf1ee55ab881670c2d7bb3b54d60c3b59 | |
parent | 59ed933d6c43ecb0ddd3dec53cc289ee8aa68482 (diff) | |
download | kdepimpi-d68435216e1ebc5a7fed391157197994e13992b3.zip kdepimpi-d68435216e1ebc5a7fed391157197994e13992b3.tar.gz kdepimpi-d68435216e1ebc5a7fed391157197994e13992b3.tar.bz2 |
sync fix
-rw-r--r-- | kabc/addressbook.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index ff05f7e..16927e2 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp @@ -431,37 +431,45 @@ void AddressBook::importFromFile( QString fileName, bool replaceLabel, bool rem (*it).setTagged( true ); insertAddressee( (*it), false, true ); } if ( removeOld ) removeUntagged(); } void AddressBook::setUntagged() { Iterator ait; for ( ait = begin(); ait != end(); ++ait ) { (*ait).setTagged( false ); } } void AddressBook::removeUntagged() { Iterator ait; + bool todelete = false; + Iterator todel; for ( ait = begin(); ait != end(); ++ait ) { - if (!(*ait).tagged()) - removeAddressee( ait ); + if ( todelete ) + removeAddressee( todel ); + if (!(*ait).tagged()) { + todelete = true; + todel = ait; + } else + todelete = false; } - + if ( todelete ) + removeAddressee( todel ); deleteRemovedAddressees(); } bool AddressBook::saveAB() { bool ok = true; deleteRemovedAddressees(); Iterator ait; for ( ait = begin(); ait != end(); ++ait ) { if ( !(*ait).IDStr().isEmpty() ) { (*ait).insertCustom( "KADDRESSBOOK", "X-ExternalID", (*ait).IDStr() ); } } KRES::Manager<Resource>::ActiveIterator it; KRES::Manager<Resource> *manager = d->mManager; for ( it = manager->activeBegin(); it != manager->activeEnd(); ++it ) { |