summaryrefslogtreecommitdiffabout
path: root/kabc/vcardformatimpl.cpp
Side-by-side diff
Diffstat (limited to 'kabc/vcardformatimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/vcardformatimpl.cpp25
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
@@ -27,8 +27,11 @@ $Id$
#include <qfile.h>
#include <qregexp.h>
#include <qapplication.h>
+//Added by qt3to4:
+#include <Q3CString>
+#include <Q3PtrList>
#include <kdebug.h>
#include <kmdcodec.h>
#include <kstandarddirs.h>
@@ -53,9 +56,9 @@ bool VCardFormatImpl::load( Addressee &addressee, QFile *file )
{
kdDebug(5700) << "VCardFormat::load()" << endl;
QByteArray fdata = file->readAll();
- QCString data(fdata.data(), fdata.size()+1);
+ Q3CString data(fdata.data(), fdata.size()+1);
VCardEntity e( data );
VCardListIterator it( e.cardList() );
@@ -74,9 +77,9 @@ bool VCardFormatImpl::load( Addressee &addressee, QFile *file )
#include <kmessagebox.h>
bool VCardFormatImpl::loadAll( AddressBook *addressBook, Resource *resource, QFile *file )
{
- QCString data(file->readAll().data(), file->size()+1);
+ Q3CString data(file->readAll().data(), file->size()+1);
VCardEntity e( data );
VCardListIterator it( e.cardList() );
@@ -107,9 +110,9 @@ void VCardFormatImpl::save( const Addressee &addressee, QFile *file )
vcardlist.append( v );
vcards.setCardList( vcardlist );
- QCString vcardData = vcards.asString();
+ Q3CString vcardData = vcards.asString();
file->writeBlock( (const char*)vcardData, vcardData.length() );
}
void VCardFormatImpl::saveAll( AddressBook *ab, Resource *resource, QFile *file )
@@ -128,13 +131,13 @@ 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 );
int posDash = n.find( "-" );
addressee.insertCustom( QString::fromUtf8( n.left( posDash ) ),
@@ -218,9 +221,9 @@ bool VCardFormatImpl::loadAddressee( Addressee& addressee, VCard *v )
addressee.setCategories( QStringList::split( ",", readTextValue( cl ) ) );
break;
case EntityBirthday:
- addressee.setBirthday( readDateValue( cl ) );
+ addressee.setBirthday( (QDateTime) readDateValue( cl ) );
break;
case EntityRevision:
addressee.setRevision( readDateTimeValue( cl ) );
@@ -529,9 +532,9 @@ int VCardFormatImpl::readAddressParam( ContentLine *cl )
{
int type = 0;
ParamList params = cl->paramList();
ParamListIterator it( params );
- QCString tmpStr;
+ Q3CString tmpStr;
for( ; it.current(); ++it ) {
if ( (*it)->name().upper() == "TYPE" ) {
tmpStr = (*it)->value().lower();
if ( tmpStr == "dom" ) type |= Address::Dom;
@@ -608,9 +611,9 @@ PhoneNumber VCardFormatImpl::readTelephoneValue( ContentLine *cl )
int type = 0;
ParamList params = cl->paramList();
ParamListIterator it( params );
- QCString tmpStr;
+ Q3CString tmpStr;
for( ; it.current(); ++it ) {
if ( (*it)->name() == "TYPE" ) {
tmpStr = (*it)->value().lower();
if ( tmpStr == "home" ) type |= PhoneNumber::Home;
@@ -869,9 +872,9 @@ void VCardFormatImpl::addPictureValue( VCARD::VCard *vcard, VCARD::EntityType ty
if ( pic.isIntern() ) {
QImage img = pic.data();
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;
cl.setValue( new TextValue( KCodecs::base64Encode( data ) ) );
params.append( new Param( "ENCODING", "b" ) );
@@ -958,9 +961,9 @@ void VCardFormatImpl::addSoundValue( VCARD::VCard *vcard, const Sound &sound, co
if ( intern ) { // only for vCard export we really write the data inline
cl.setValue( new TextValue( KCodecs::base64Encode( data ) ) );
} 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 );
}
cl.setValue( new TextValue( "<dummy>" ) );
}
@@ -990,9 +993,9 @@ Sound VCardFormatImpl::readSoundValue( VCARD::ContentLine *cl, const Addressee &
if ( isInline ) {
QByteArray data;
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();
}
} else {