[Kde-pim] KDE/kdepim/kaddressbook
Kevin Krammer
kevin.krammer at gmx.at
Sun Jun 8 19:33:47 BST 2008
SVN commit 818532 by krake:
QList::erase changes end() so caching it resulted in a crash.
Reported during Krush day as
"katastrophe 14:14, 8 June 2008 (CEST) crash if you make a new distribution list and change its name, then click ok"
Actually already crashes when creating a new distribution list and keeping the default name.
Most likely introduced during Qt4 porting, e.g. different behavior or Qt3's QValueList and Qt4's QList regarding erase() and/or end()
so it could be somewhere else as well.
CCMAIL: kde-pim at kde.org
M +3 -4 searchmanager.cpp
--- trunk/KDE/kdepim/kaddressbook/searchmanager.cpp #818531:818532
@@ -53,8 +53,7 @@
// Extract distribution lists from allContacts
mDistributionLists.clear();
KABC::Addressee::List::Iterator rmIt( allContacts.begin() );
- const KABC::Addressee::List::Iterator rmEndIt( allContacts.end() );
- while ( rmIt != rmEndIt ) {
+ while ( rmIt != allContacts.constEnd() ) {
if ( KPIM::DistributionList::isDistributionList( *rmIt ) ) {
mDistributionLists.append( static_cast<KPIM::DistributionList>( *rmIt ) );
rmIt = allContacts.erase( rmIt );
@@ -70,7 +69,7 @@
const Entry::List entries = dl.entries( mAddressBook );
const Entry::List::ConstIterator end = entries.end();
for ( Entry::List::ConstIterator it = entries.begin(); it != end; ++it ) {
- allContacts.append( (*it).addressee );
+ allContacts.append( (*it).addressee );
}
}
}
@@ -160,7 +159,7 @@
void KAB::SearchManager::setSelectedDistributionList( const QString &name )
{
if ( mSelectedDistributionList == name )
- return;
+ return;
mSelectedDistributionList = name;
reload();
}
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list