SVN commit 840343 by tmcguire: Don't crash when running the anti-spam wizard and spam filter rules exist already. I've simply replaced an iterator-loop with a for-loop, can anybody who understands iterators point me to the reason why the iterator-based version crashed? Because I have no idea. (I also tried removing the const from the iterator, but that didn't help) BUG: 166477 M +5 -5 kmfiltermgr.cpp --- trunk/KDE/kdepim/kmail/kmfiltermgr.cpp #840342:840343 @@ -451,11 +451,11 @@ if ( replaceIfNameExists ) { QList::const_iterator it1 = filters.begin(); for ( ; it1 != filters.end() ; ++it1 ) { - QList::const_iterator it2 = mFilters.begin(); - for ( ; it2 != mFilters.end() ; ++it2 ) { - if ( (*it1)->name() == (*it2)->name() ) { - mFilters.removeAll( (*it2) ); - it2 = mFilters.constBegin(); + for ( int i = 0; i < mFilters.count(); i++ ) { + KMFilter *filter = mFilters[i]; + if ( (*it1)->name() == filter->name() ) { + mFilters.removeAll( filter ); + i = 0; } } }