author | zautrix <zautrix> | 2005-07-06 09:29:15 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-06 09:29:15 (UTC) |
commit | 38c8ca3f376451c072650fad8964adbbc513a105 (patch) (side-by-side diff) | |
tree | b1d4f1cec8b208294a16ff0d88ef6f8d5812c887 /kabc | |
parent | 68016257abe13019610cb7bb230f8d754179abfb (diff) | |
download | kdepimpi-38c8ca3f376451c072650fad8964adbbc513a105.zip kdepimpi-38c8ca3f376451c072650fad8964adbbc513a105.tar.gz kdepimpi-38c8ca3f376451c072650fad8964adbbc513a105.tar.bz2 |
fixxxx
-rw-r--r-- | kabc/vcardformatimpl.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/kabc/vcardformatimpl.cpp b/kabc/vcardformatimpl.cpp index b9fe6ff..ec5ed80 100644 --- a/kabc/vcardformatimpl.cpp +++ b/kabc/vcardformatimpl.cpp @@ -24,12 +24,13 @@ Copyright (c) 2004 Ulf Schenk $Id$ */ #include <qfile.h> #include <qregexp.h> +#include <qapplication.h> #include <kdebug.h> #include <kmdcodec.h> #include <kstandarddirs.h> #include <ktempfile.h> @@ -66,19 +67,18 @@ bool VCardFormatImpl::load( Addressee &addressee, QFile *file ) return true; } return false; } + +#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 ); VCardListIterator it( e.cardList() ); for (; it.current(); ++it) { //US VCard v(*it.current()); @@ -89,13 +89,12 @@ bool VCardFormatImpl::loadAll( AddressBook *addressBook, Resource *resource, QFi addressBook->insertAddressee( addressee ); if (debug == true) { printf("address %s loaded successfully\n", addressee.formattedName().latin1()); } } - return true; } void VCardFormatImpl::save( const Addressee &addressee, QFile *file ) { VCardEntity vcards; @@ -112,30 +111,23 @@ void VCardFormatImpl::save( const Addressee &addressee, QFile *file ) QCString vcardData = vcards.asString(); file->writeBlock( (const char*)vcardData, vcardData.length() ); } void VCardFormatImpl::saveAll( AddressBook *ab, Resource *resource, QFile *file ) { - VCardEntity vcards; - VCardList vcardlist; - vcardlist.setAutoDelete( true ); 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 ) { QPtrList<ContentLine> contentLines = v->contentLineList(); ContentLine *cl; |