author | zautrix <zautrix> | 2005-01-06 00:18:02 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-06 00:18:02 (UTC) |
commit | 5e7c3e3e51fa939e97b73e6443089edcec8dc663 (patch) (side-by-side diff) | |
tree | 213be239777ec911d364f736f9e6cef1f62a7c68 /kabc | |
parent | 0618fbee69bfde7f7f3c4a54b5cc45dac446abd3 (diff) | |
download | kdepimpi-5e7c3e3e51fa939e97b73e6443089edcec8dc663.zip kdepimpi-5e7c3e3e51fa939e97b73e6443089edcec8dc663.tar.gz kdepimpi-5e7c3e3e51fa939e97b73e6443089edcec8dc663.tar.bz2 |
kapi pic fix
-rw-r--r-- | kabc/vcardformatimpl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kabc/vcardformatimpl.cpp b/kabc/vcardformatimpl.cpp index c31af46..b9fe6ff 100644 --- a/kabc/vcardformatimpl.cpp +++ b/kabc/vcardformatimpl.cpp @@ -78,97 +78,97 @@ bool VCardFormatImpl::loadAll( AddressBook *addressBook, Resource *resource, QFi VCardEntity e( data ); VCardListIterator it( e.cardList() ); for (; it.current(); ++it) { //US VCard v(*it.current()); Addressee addressee; //US loadAddressee( addressee, v ); loadAddressee( addressee, it.current() ); addressee.setResource( resource ); 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; VCardList vcardlist; vcardlist.setAutoDelete( true ); VCard *v = new VCard; saveAddressee( addressee, v, false ); vcardlist.append( v ); vcards.setCardList( vcardlist ); 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, false ); + saveAddressee( (*it), v, true ); (*it).setChanged( false ); vcardlist.append( v ); } } vcards.setCardList( vcardlist ); QCString vcardData = vcards.asString(); file->writeBlock( (const char*)vcardData, vcardData.length() ); } bool VCardFormatImpl::loadAddressee( Addressee& addressee, VCard *v ) { QPtrList<ContentLine> contentLines = v->contentLineList(); ContentLine *cl; for( cl = contentLines.first(); cl; cl = contentLines.next() ) { QCString n = cl->name(); if ( n.left( 2 ) == "X-" ) { n = n.mid( 2 ); int posDash = n.find( "-" ); addressee.insertCustom( QString::fromUtf8( n.left( posDash ) ), QString::fromUtf8( n.mid( posDash + 1 ) ), QString::fromUtf8( cl->value()->asString() ) ); continue; } EntityType type = cl->entityType(); switch( type ) { case EntityUID: addressee.setUid( readTextValue( cl ) ); break; case EntityEmail: addressee.insertEmail( readTextValue( cl ) ); break; case EntityName: addressee.setName( readTextValue( cl ) ); break; case EntityFullName: addressee.setFormattedName( readTextValue( cl ) ); break; case EntityURL: addressee.setUrl( KURL( readTextValue( cl ) ) ); |