summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-07-06 15:55:15 (UTC)
committer zautrix <zautrix>2004-07-06 15:55:15 (UTC)
commit45e2744074e876a74919b340efc320bdadadcb25 (patch) (side-by-side diff)
tree5fac15064970f378dc59284b451491d924c7e5b2
parent60ec860b41d2af2444955e5cc3d04d132c76dbbb (diff)
downloadkdepimpi-45e2744074e876a74919b340efc320bdadadcb25.zip
kdepimpi-45e2744074e876a74919b340efc320bdadadcb25.tar.gz
kdepimpi-45e2744074e876a74919b340efc320bdadadcb25.tar.bz2
Fixed a crash
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 7cba9aa..3ae23e8 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -757,63 +757,62 @@ void KABCore::contactModified( const KABC::Addressee &addr )
KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() );
if ( origAddr.isEmpty() )
command = new PwNewCommand( mAddressBook, addr );
else {
command = new PwEditCommand( mAddressBook, origAddr, addr );
uid = addr.uid();
}
UndoStack::instance()->push( command );
RedoStack::instance()->clear();
setModified( true );
}
void KABCore::newContact()
{
- AddresseeEditorDialog *dialog = 0;
+
QPtrList<KABC::Resource> kabcResources = mAddressBook->resources();
QPtrList<KRES::Resource> kresResources;
QPtrListIterator<KABC::Resource> it( kabcResources );
KABC::Resource *resource;
while ( ( resource = it.current() ) != 0 ) {
++it;
if ( !resource->readOnly() ) {
KRES::Resource *res = static_cast<KRES::Resource*>( resource );
if ( res )
kresResources.append( res );
}
}
KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, this );
resource = static_cast<KABC::Resource*>( res );
if ( resource ) {
KABC::Addressee addr;
addr.setResource( resource );
mEditorDialog->setAddressee( addr );
KApplication::execDialog ( mEditorDialog );
} else
return;
// mEditorDict.insert( dialog->addressee().uid(), dialog );
- dialog->show();
}
void KABCore::addEmail( QString aStr )
{
#ifndef KAB_EMBEDDED
QString fullName, email;
KABC::Addressee::parseEmailAddress( aStr, fullName, email );
// Try to lookup the addressee matching the email address
bool found = false;
QStringList emailList;
KABC::AddressBook::Iterator it;
for ( it = mAddressBook->begin(); !found && (it != mAddressBook->end()); ++it ) {
emailList = (*it).emails();