From a08aff328d4393031d5ba7d622c2b05705a89d73 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Wed, 04 Jul 2007 11:23:42 +0000 Subject: initial public commit of qt4 port --- (limited to 'kabc/addressbook.cpp') diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index fe59fcb..c700897 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp @@ -37,8 +37,8 @@ $Id$ #include "errorhandler.h" */ -#include -#include +#include +#include #include #include @@ -244,7 +244,7 @@ void AddressBook::init(const QString &config, const QString &family ) blockLSEchange = false; d = new AddressBookData; QString fami = family; - if (config != 0) { + if (!config.isEmpty()) { if ( family == "syncContact" ) { qDebug("creating sync config "); fami = "contact"; @@ -381,13 +381,13 @@ void AddressBook::export2File( QString fileName, QString resourceName ) { QFile outFile( fileName ); - if ( !outFile.open( IO_WriteOnly ) ) { + if ( !outFile.open( QIODevice::WriteOnly ) ) { QString text = i18n( "Unable to open file %1 for export." ); KMessageBox::error( 0, text.arg( fileName ) ); return ; } - QTextStream t( &outFile ); - t.setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream t( &outFile ); + t.setEncoding( Q3TextStream::UnicodeUTF8 ); Iterator it; KABC::VCardConverter::Version version; version = KABC::VCardConverter::v3_0; @@ -468,10 +468,10 @@ bool AddressBook::export2PhoneFormat( QStringList uids ,QString fileName ) } QFile outFile(fileName); - if ( outFile.open(IO_WriteOnly) ) { + if ( outFile.open(QIODevice::WriteOnly) ) { datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); - QTextStream t( &outFile ); // use a text stream - t.setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream t( &outFile ); // use a text stream + t.setEncoding( Q3TextStream::UnicodeUTF8 ); t < mResources = resources(); + Q3PtrList mResources = resources(); - QPtrListIterator it(mResources); + Q3PtrListIterator it(mResources); for ( ; it.current(); ++it ) { KABC::Resource *res = it.current(); removeResource(res); @@ -1240,9 +1240,9 @@ bool AddressBook::removeResource( Resource *resource ) return true; } -QPtrList AddressBook::resources() +Q3PtrList AddressBook::resources() { - QPtrList list; + Q3PtrList list; // qDebug("AddressBook::resources() 1"); -- cgit v0.9.0.2