-rw-r--r-- | kabc/vcardformatimpl.cpp | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/kabc/vcardformatimpl.cpp b/kabc/vcardformatimpl.cpp index b9fe6ff..ec5ed80 100644 --- a/kabc/vcardformatimpl.cpp +++ b/kabc/vcardformatimpl.cpp @@ -29,2 +29,3 @@ $Id$ #include <qregexp.h> +#include <qapplication.h> @@ -71,9 +72,8 @@ bool VCardFormatImpl::load( Addressee &addressee, QFile *file ) + +#include <kmessagebox.h> 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 ); @@ -94,3 +94,2 @@ bool VCardFormatImpl::loadAll( AddressBook *addressBook, Resource *resource, QFi } - return true; @@ -117,20 +116,13 @@ 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 ") ); } |