-rw-r--r-- | kabc/plugins/opie/resourceopie.cpp | 7 | ||||
-rw-r--r-- | kaddressbook/xxport/opie/opie_xxport.cpp | 10 |
2 files changed, 14 insertions, 3 deletions
diff --git a/kabc/plugins/opie/resourceopie.cpp b/kabc/plugins/opie/resourceopie.cpp index f992301..a4f8d8a 100644 --- a/kabc/plugins/opie/resourceopie.cpp +++ b/kabc/plugins/opie/resourceopie.cpp @@ -43,12 +43,13 @@ $Id$ #include <kstandarddirs.h> //US #include "formatfactory.h" //US #include <qpe/qpeapplication.h> #include <opie/ocontactaccess.h> +#include <opie/ocontactaccessbackend_xml.h> #include "resource.h" #include "resourceopieconfig.h" #include "stdaddressbook.h" #include "opieconverter.h" @@ -177,13 +178,16 @@ void ResourceOpie::doClose() bool ResourceOpie::load() { // qDebug("ResourceOpie::load() %s", mFileName.latin1()); kdDebug(5700) << "ResourceOpie::load(): '" << mFileName << "'" << endl; - OContactAccess* access = new OContactAccess("KDEPim/Pi", mFileName, 0l, false); + qDebug("ResourceOpie::load: Try to load file() %s", mFileName.latin1()); + + OContactAccessBackend_XML* backend = new OContactAccessBackend_XML( "KDEPim/Pi", mFileName ); + OContactAccess* access = new OContactAccess("KDEPim/Pi", 0l, backend, false); if ( !access ) { qDebug("Unable to load file() %s", mFileName.latin1()); addressBook()->error( i18n( "Unable to load file '%1'." ).arg( mFileName ) ); return false; } @@ -212,12 +216,13 @@ bool ResourceOpie::load() } // qDebug("found %s", c.fullName().latin1()); } delete access; + delete backend; return true; } bool ResourceOpie::save( Ticket *ticket ) { diff --git a/kaddressbook/xxport/opie/opie_xxport.cpp b/kaddressbook/xxport/opie/opie_xxport.cpp index 90d05cd..f30a205 100644 --- a/kaddressbook/xxport/opie/opie_xxport.cpp +++ b/kaddressbook/xxport/opie/opie_xxport.cpp @@ -31,12 +31,14 @@ $Id$ #include <qdir.h> #include <kfiledialog.h> #include <kmessagebox.h> #include <opie/ocontactaccess.h> +#include <opie/ocontactaccessbackend_xml.h> + #include "stdaddressbook.h" /*US #include <qfile.h> #include <qtextstream.h> @@ -93,13 +95,14 @@ bool OpieXXPort::exportContacts( const KABC::AddresseeList &list, const QString QString fileName = KFileDialog::getSaveFileName( name, i18n("Save file"), parentWidget() ); #endif //KAB_EMBEDDED if ( fileName.isEmpty() ) return true; - OContactAccess* access = new OContactAccess("KA/Pi", fileName, 0l, false); + 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()); addressBook()->error( i18n( "Unable to access file '%1'." ).arg( fileName ) ); return false; } @@ -136,12 +139,13 @@ bool OpieXXPort::exportContacts( const KABC::AddresseeList &list, const QString } } access->save(); delete access; + delete backend; return true; } KABC::AddresseeList OpieXXPort::importContacts( const QString& ) const { @@ -155,13 +159,14 @@ KABC::AddresseeList OpieXXPort::importContacts( const QString& ) const QString fileName = KFileDialog::getOpenFileName( name, i18n("Load file"), parentWidget() ); #endif //KAB_EMBEDDED if ( fileName.isEmpty() ) return KABC::AddresseeList(); - OContactAccess* access = new OContactAccess("KA/Pi", fileName, 0l, false); + 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()); addressBook()->error( i18n( "Unable to access file '%1'." ).arg( fileName ) ); return KABC::AddresseeList(); } @@ -187,10 +192,11 @@ KABC::AddresseeList OpieXXPort::importContacts( const QString& ) const } // qDebug("found %s", c.fullName().latin1()); } delete access; + delete backend; return adrlst; } |