From 38c8ca3f376451c072650fad8964adbbc513a105 Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 06 Jul 2005 09:29:15 +0000 Subject: fixxxx --- (limited to 'kabc') diff --git a/kabc/vcardformatimpl.cpp b/kabc/vcardformatimpl.cpp index b9fe6ff..ec5ed80 100644 --- a/kabc/vcardformatimpl.cpp +++ b/kabc/vcardformatimpl.cpp @@ -27,6 +27,7 @@ $Id$ #include #include +#include #include #include @@ -69,13 +70,12 @@ bool VCardFormatImpl::load( Addressee &addressee, QFile *file ) return false; } + +#include bool VCardFormatImpl::loadAll( AddressBook *addressBook, Resource *resource, QFile *file ) { - kdDebug(5700) << "VCardFormat::loadAll()" << endl; - - QByteArray fdata = file->readAll(); - QCString data(fdata.data(), fdata.size()+1); - + + QCString data(file->readAll().data(), file->size()+1); VCardEntity e( data ); VCardListIterator it( e.cardList() ); @@ -92,7 +92,6 @@ bool VCardFormatImpl::loadAll( AddressBook *addressBook, Resource *resource, QFi printf("address %s loaded successfully\n", addressee.formattedName().latin1()); } } - return true; } @@ -115,24 +114,17 @@ void VCardFormatImpl::save( const Addressee &addressee, QFile *file ) void VCardFormatImpl::saveAll( AddressBook *ab, Resource *resource, QFile *file ) { - VCardEntity vcards; - VCardList vcardlist; - vcardlist.setAutoDelete( true ); - AddressBook::Iterator it; + AddressBook::Iterator it; for ( it = ab->begin(); it != ab->end(); ++it ) { if ( (*it).resource() == resource ) { - VCard *v = new VCard; - saveAddressee( (*it), v, true ); + save((*it),file); + qApp->processEvents(); (*it).setChanged( false ); - vcardlist.append( v ); } } - - vcards.setCardList( vcardlist ); - - QCString vcardData = vcards.asString(); - file->writeBlock( (const char*)vcardData, vcardData.length() ); + // for memory usage status test only + // KMessageBox::information ( 0, "Stoppppp", QString("Stop ") ); } bool VCardFormatImpl::loadAddressee( Addressee& addressee, VCard *v ) -- cgit v0.9.0.2