summaryrefslogtreecommitdiffabout
path: root/kaddressbook/xxport/opie/opie_xxport.cpp
authorulf69 <ulf69>2004-07-06 04:04:56 (UTC)
committer ulf69 <ulf69>2004-07-06 04:04:56 (UTC)
commitc4bd138c16e8d34294502c9da5706e21337ba53d (patch) (side-by-side diff)
tree08f15d9575264b04bcb0135077918175e2cd1650 /kaddressbook/xxport/opie/opie_xxport.cpp
parent6a826e654102e78abb6d14f80a3679575e5d3c9a (diff)
downloadkdepimpi-c4bd138c16e8d34294502c9da5706e21337ba53d.zip
kdepimpi-c4bd138c16e8d34294502c9da5706e21337ba53d.tar.gz
kdepimpi-c4bd138c16e8d34294502c9da5706e21337ba53d.tar.bz2
ok button of dialog works now. import of vcards works now, export of opie resources too.
Diffstat (limited to 'kaddressbook/xxport/opie/opie_xxport.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/xxport/opie/opie_xxport.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/kaddressbook/xxport/opie/opie_xxport.cpp b/kaddressbook/xxport/opie/opie_xxport.cpp
index f30a205..d1def18 100644
--- a/kaddressbook/xxport/opie/opie_xxport.cpp
+++ b/kaddressbook/xxport/opie/opie_xxport.cpp
@@ -121,49 +121,49 @@ bool OpieXXPort::exportContacts( const KABC::AddresseeList &list, const QString
KABC::OpieConverter mConverter;
bool res;
KABC::Addressee::List::ConstIterator it;
for ( it = list.begin(); it != list.end(); ++it ) {
OContact c;
KABC::Addressee addressee = (*it);
res = mConverter.addresseeToOpie( *it, c );
if (res == true)
{
res = access->add(c);
if (res == false)
qDebug("Unable to append Contact %s", c.fullName().latin1());
}
else
{
qDebug("Unable to convert Addressee %s", addressee.formattedName().latin1());
}
}
access->save();
delete access;
- delete backend;
+//US the deletion of the access object deletes the backend object as well.
return true;
}
KABC::AddresseeList OpieXXPort::importContacts( const QString& ) const
{
KABC::AddresseeList adrlst;
QString name = QDir::homeDirPath() + "/Applications/addressbook/addressbook.xml";
#ifndef KAB_EMBEDDED
QString fileName = KFileDialog::getOpenFileName( name );
#else //KAB_EMBEDDED
QString fileName = KFileDialog::getOpenFileName( name, i18n("Load file"), parentWidget() );
#endif //KAB_EMBEDDED
if ( fileName.isEmpty() )
return KABC::AddresseeList();
OContactAccessBackend_XML* backend = new OContactAccessBackend_XML( "KA/Pi", fileName );
OContactAccess* access = new OContactAccess("KA/Pi", 0l, backend, false);
if ( !access ) {
qDebug("Unable to access file() %s", fileName.latin1());
@@ -174,29 +174,29 @@ KABC::AddresseeList OpieXXPort::importContacts( const QString& ) const
access -> setReadAhead( 32 ); // Use ReadAhead-Cache if available
KABC::OpieConverter mConverter;
bool res = false;
OContactAccess::List::Iterator it;
OContactAccess::List allList = access->allRecords();
for ( it = allList.begin(); it != allList.end(); ++it )
{
OContact c = (*it);
KABC::Addressee addressee;
res = mConverter.opieToAddressee( c, addressee );
if ( !addressee.isEmpty() && res ) {
adrlst.append( addressee );
}
// qDebug("found %s", c.fullName().latin1());
}
delete access;
- delete backend;
+//US the deletion of the access object deletes the backend object as well.
return adrlst;
}