-rw-r--r-- | kabc/vcardformatimpl.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/kabc/vcardformatimpl.cpp b/kabc/vcardformatimpl.cpp index 580c28b..2417874 100644 --- a/kabc/vcardformatimpl.cpp +++ b/kabc/vcardformatimpl.cpp @@ -29,4 +29,7 @@ $Id$ #include <qregexp.h> #include <qapplication.h> +//Added by qt3to4: +#include <Q3CString> +#include <Q3PtrList> #include <kdebug.h> @@ -55,5 +58,5 @@ bool VCardFormatImpl::load( Addressee &addressee, QFile *file ) QByteArray fdata = file->readAll(); - QCString data(fdata.data(), fdata.size()+1); + Q3CString data(fdata.data(), fdata.size()+1); VCardEntity e( data ); @@ -76,5 +79,5 @@ bool VCardFormatImpl::loadAll( AddressBook *addressBook, Resource *resource, QFi { - QCString data(file->readAll().data(), file->size()+1); + Q3CString data(file->readAll().data(), file->size()+1); VCardEntity e( data ); @@ -109,5 +112,5 @@ void VCardFormatImpl::save( const Addressee &addressee, QFile *file ) vcards.setCardList( vcardlist ); - QCString vcardData = vcards.asString(); + Q3CString vcardData = vcards.asString(); file->writeBlock( (const char*)vcardData, vcardData.length() ); } @@ -130,9 +133,9 @@ void VCardFormatImpl::saveAll( AddressBook *ab, Resource *resource, QFile *file bool VCardFormatImpl::loadAddressee( Addressee& addressee, VCard *v ) { - QPtrList<ContentLine> contentLines = v->contentLineList(); + Q3PtrList<ContentLine> contentLines = v->contentLineList(); ContentLine *cl; for( cl = contentLines.first(); cl; cl = contentLines.next() ) { - QCString n = cl->name(); + Q3CString n = cl->name(); if ( n.left( 2 ) == "X-" ) { n = n.mid( 2 ); @@ -220,5 +223,5 @@ bool VCardFormatImpl::loadAddressee( Addressee& addressee, VCard *v ) case EntityBirthday: - addressee.setBirthday( readDateValue( cl ) ); + addressee.setBirthday( (QDateTime) readDateValue( cl ) ); break; @@ -531,5 +534,5 @@ int VCardFormatImpl::readAddressParam( ContentLine *cl ) ParamList params = cl->paramList(); ParamListIterator it( params ); - QCString tmpStr; + Q3CString tmpStr; for( ; it.current(); ++it ) { if ( (*it)->name().upper() == "TYPE" ) { @@ -610,5 +613,5 @@ PhoneNumber VCardFormatImpl::readTelephoneValue( ContentLine *cl ) ParamList params = cl->paramList(); ParamListIterator it( params ); - QCString tmpStr; + Q3CString tmpStr; for( ; it.current(); ++it ) { if ( (*it)->name() == "TYPE" ) { @@ -871,5 +874,5 @@ void VCardFormatImpl::addPictureValue( VCARD::VCard *vcard, VCARD::EntityType ty if ( intern ) { // only for vCard export we really write the data inline QByteArray data; - QDataStream s( data, IO_WriteOnly ); + QDataStream s( &data, QIODevice::WriteOnly ); s.setVersion( 4 ); // to produce valid png files s << img; @@ -960,5 +963,5 @@ void VCardFormatImpl::addSoundValue( VCARD::VCard *vcard, const Sound &sound, co } else { // save sound in cache QFile file( locateLocal( "data", "kabc/sounds/" + addr.uid() ) ); - if ( file.open( IO_WriteOnly ) ) { + if ( file.open( QIODevice::WriteOnly ) ) { file.writeBlock( data ); } @@ -992,5 +995,5 @@ Sound VCardFormatImpl::readSoundValue( VCARD::ContentLine *cl, const Addressee & if ( v->asString() == "<dummy>" ) { // no sound inline stored => sound is in cache QFile file( locateLocal( "data", "kabc/sounds/" + addr.uid() ) ); - if ( file.open( IO_ReadOnly ) ) { + if ( file.open( QIODevice::ReadOnly ) ) { data = file.readAll(); file.close(); |