summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kabc/addressbook.cpp14
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
@@ -444,11 +444,19 @@ void AddressBook::setUntagged()
444void AddressBook::removeUntagged() 444void AddressBook::removeUntagged()
445{ 445{
446 Iterator ait; 446 Iterator ait;
447 bool todelete = false;
448 Iterator todel;
447 for ( ait = begin(); ait != end(); ++ait ) { 449 for ( ait = begin(); ait != end(); ++ait ) {
448 if (!(*ait).tagged()) 450 if ( todelete )
449 removeAddressee( ait ); 451 removeAddressee( todel );
452 if (!(*ait).tagged()) {
453 todelete = true;
454 todel = ait;
455 } else
456 todelete = false;
450 } 457 }
451 458 if ( todelete )
459 removeAddressee( todel );
452 deleteRemovedAddressees(); 460 deleteRemovedAddressees();
453} 461}
454bool AddressBook::saveAB() 462bool AddressBook::saveAB()