summaryrefslogtreecommitdiffabout
path: root/kabc
Side-by-side diff
Diffstat (limited to 'kabc') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/opie/resourceopie.cpp9
1 files changed, 7 insertions, 2 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
@@ -37,24 +37,25 @@ $Id$
#include <kapplication.h>
#include <kconfig.h>
#include <kdebug.h>
#include <klocale.h>
//US #include <ksavefile.h>
#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"
#include "resourceopie.h"
using namespace KABC;
extern "C"
{
@@ -170,26 +171,29 @@ bool ResourceOpie::doOpen()
return true;
}
void ResourceOpie::doClose()
{
// qDebug("ResourceOpie::doClose() %s", mFileName.latin1());
}
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;
}
access -> setReadAhead( 32 ); // Use ReadAhead-Cache if available
if (mConverter == 0)
mConverter = new OpieConverter();
@@ -206,24 +210,25 @@ bool ResourceOpie::load()
res = mConverter->opieToAddressee( c, addressee );
if ( !addressee.isEmpty() && res )
{
addressee.setResource( this );
addressBook()->insertAddressee( addressee );
}
// qDebug("found %s", c.fullName().latin1());
}
delete access;
+ delete backend;
return true;
}
bool ResourceOpie::save( Ticket *ticket )
{
qDebug("ResourceOpie::save() has to be fixed - %s", mFileName.latin1());
/*US
qDebug("ResourceOpie::save %s", mFileName.latin1());
kdDebug(5700) << "ResourceOpie::save()" << endl;