From ec8315212b05c128c8d5650cf5daff2b1d6b84dd Mon Sep 17 00:00:00 2001 From: ulf69 Date: Thu, 15 Jul 2004 15:15:52 +0000 Subject: resolved crash during import of opie and qtopia addressbooks --- (limited to 'kaddressbook/xxport') diff --git a/kaddressbook/xxport/opie/opie_xxport.cpp b/kaddressbook/xxport/opie/opie_xxport.cpp index 12c83af..db30d34 100644 --- a/kaddressbook/xxport/opie/opie_xxport.cpp +++ b/kaddressbook/xxport/opie/opie_xxport.cpp @@ -184,8 +184,17 @@ KABC::AddresseeList OpieXXPort::importContacts( const QString& ) const access -> setReadAhead( 32 ); // Use ReadAhead-Cache if available KABC::OpieConverter mConverter; - bool res = false; + bool res = mConverter.init(); + if (!res) + { + QString text( i18n( "Unable to initialize opie converter.
Most likely a problem with the category file." ) ); + qDebug(text); + KMessageBox::error( parentWidget(), text ); + delete access; + return KABC::AddresseeList(); + } + OContactAccess::List::Iterator it; OContactAccess::List allList = access->allRecords(); diff --git a/kaddressbook/xxport/qtopia/qtopia_xxport.cpp b/kaddressbook/xxport/qtopia/qtopia_xxport.cpp index 3d830df..bf39fdb 100644 --- a/kaddressbook/xxport/qtopia/qtopia_xxport.cpp +++ b/kaddressbook/xxport/qtopia/qtopia_xxport.cpp @@ -163,8 +163,18 @@ KABC::AddresseeList QtopiaXXPort::importContacts( const QString& ) const } KABC::QtopiaConverter mConverter; - bool res = false; + bool res = mConverter.init(); + if (!res) + { + QString text( i18n( "Unable to initialize qtopia converter.
Most likely a problem with the category file." ) ); + qDebug(text); + KMessageBox::error( parentWidget(), text ); + delete access; + return KABC::AddresseeList(); + } + + { //create a new scope AddressBookIterator it(*access); -- cgit v0.9.0.2