Diffstat (limited to 'kabc/plugins/qtopia/qtopiaconverter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kabc/plugins/qtopia/qtopiaconverter.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/kabc/plugins/qtopia/qtopiaconverter.cpp b/kabc/plugins/qtopia/qtopiaconverter.cpp index 9693a68..9b3903b 100644 --- a/kabc/plugins/qtopia/qtopiaconverter.cpp +++ b/kabc/plugins/qtopia/qtopiaconverter.cpp @@ -31,13 +31,15 @@ $Id$ #include "qtopiaconverter.h" #include <qfile.h> #include <qdir.h> -#include <qtextstream.h> +#include <q3textstream.h> +//Added by qt3to4: +#include <Q3ValueList> //#include <.h> #include <libkdepim/ksyncprofile.h> using namespace KABC; @@ -68,14 +70,14 @@ void QtopiaConverter::deinit() } } QString QtopiaConverter::categoriesToNumber( const QStringList &list, const QString &app ) { startover: QStringList dummy; - QValueList<OpieCategories>::ConstIterator catIt; - QValueList<OpieCategories> categories = m_edit->categories(); + Q3ValueList<OpieCategories>::ConstIterator catIt; + Q3ValueList<OpieCategories> categories = m_edit->categories(); bool found = false; for ( QStringList::ConstIterator listIt = list.begin(); listIt != list.end(); ++listIt ) { /* skip empty category name */ if ( (*listIt).isEmpty() ) continue; found = false; @@ -189,13 +191,13 @@ bool QtopiaConverter::qtopiaToAddressee( const QDomElement& el, Addressee &adr ) adr.setAdditionalName( el.attribute( "MiddleName" ) ); adr.setSuffix( el.attribute( "Suffix" ) ); adr.setNickName( el.attribute( "Nickname" ) ); QDate date = dateFromString( el.attribute( "Birthday" ) ); if ( date.isValid() ) - adr.setBirthday( date ); + adr.setBirthday( (QDateTime)date ); adr.setRole( el.attribute( "JobTitle" ) ); if ( !el.attribute( "FileAs" ).isEmpty() ) adr.setFormattedName( el.attribute( "FileAs" ) ); adr.setOrganization( el.attribute( "Company" ) ); @@ -314,13 +316,13 @@ bool QtopiaConverter::qtopiaToAddressee( const QDomElement& el, Addressee &adr ) } return true; } -bool QtopiaConverter::addresseeToQtopia( const Addressee &ab, QTextStream *stream ) +bool QtopiaConverter::addresseeToQtopia( const Addressee &ab, Q3TextStream *stream ) { *stream << "<Contact "; *stream << "FirstName=\"" << escape(ab.givenName()) << "\" "; *stream << "MiddleName=\"" << escape(ab.additionalName()) << "\" "; *stream << "LastName=\"" << escape(ab.familyName()) << "\" "; *stream << "Suffix=\"" << escape(ab.suffix()) << "\" "; @@ -481,19 +483,19 @@ CategoryEdit::CategoryEdit(const QString &fileName){ } CategoryEdit::~CategoryEdit(){ } void CategoryEdit::save(const QString& fileName)const{ QFile file( fileName ); QString endl = "\n"; - if ( file.open( IO_WriteOnly ) ) { - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + if ( file.open( QIODevice::WriteOnly ) ) { + Q3TextStream stream( &file ); + stream.setEncoding( Q3TextStream::UnicodeUTF8 ); stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl; stream << "<!DOCTYPE CategoryList>" << endl; stream << "<Categories>" << endl; - for ( QValueList<OpieCategories>::ConstIterator it = m_categories.begin(); + for ( Q3ValueList<OpieCategories>::ConstIterator it = m_categories.begin(); it != m_categories.end(); ++it ) { stream << "<Category id=\""<< ( (*it).id() ) << "\" "; if ( !(*it).app().isEmpty() ) stream << " app=\""<< ( (*it).app() ) << "\" "; @@ -534,13 +536,13 @@ int CategoryEdit::addCategory( const QString &appName, const QString &name, in */ void CategoryEdit::parse( const QString &tempFile ){ clear(); QDomDocument doc( "mydocument" ); QFile f( tempFile ); - if ( !f.open( IO_ReadOnly ) ) + if ( !f.open( QIODevice::ReadOnly ) ) return; if ( !doc.setContent( &f ) ) { f.close(); return; } @@ -584,13 +586,13 @@ void CategoryEdit::clear() { ids.clear(); m_categories.clear(); } QString CategoryEdit::categoryById( const QString &id, const QString &app )const { - QValueList<OpieCategories>::ConstIterator it; + Q3ValueList<OpieCategories>::ConstIterator it; QString category; QString fallback; for( it = m_categories.begin(); it != m_categories.end(); ++it ){ if( id.stripWhiteSpace() == (*it).id().stripWhiteSpace() ){ if( app == (*it).app() ){ category = (*it).name(); |