summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/qtopia/qtopiaconverter.cpp
Unidiff
Diffstat (limited to 'kabc/plugins/qtopia/qtopiaconverter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/qtopia/qtopiaconverter.cpp24
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
@@ -34,7 +34,9 @@ $Id$
34 34
35#include <qfile.h> 35#include <qfile.h>
36#include <qdir.h> 36#include <qdir.h>
37#include <qtextstream.h> 37#include <q3textstream.h>
38//Added by qt3to4:
39#include <Q3ValueList>
38//#include <.h> 40//#include <.h>
39 41
40#include <libkdepim/ksyncprofile.h> 42#include <libkdepim/ksyncprofile.h>
@@ -71,8 +73,8 @@ QString QtopiaConverter::categoriesToNumber( const QStringList &list, const QStr
71{ 73{
72 startover: 74 startover:
73 QStringList dummy; 75 QStringList dummy;
74 QValueList<OpieCategories>::ConstIterator catIt; 76 Q3ValueList<OpieCategories>::ConstIterator catIt;
75 QValueList<OpieCategories> categories = m_edit->categories(); 77 Q3ValueList<OpieCategories> categories = m_edit->categories();
76 bool found = false; 78 bool found = false;
77 for ( QStringList::ConstIterator listIt = list.begin(); listIt != list.end(); ++listIt ) { 79 for ( QStringList::ConstIterator listIt = list.begin(); listIt != list.end(); ++listIt ) {
78 /* skip empty category name */ 80 /* skip empty category name */
@@ -192,7 +194,7 @@ bool QtopiaConverter::qtopiaToAddressee( const QDomElement& el, Addressee &adr )
192 194
193 QDate date = dateFromString( el.attribute( "Birthday" ) ); 195 QDate date = dateFromString( el.attribute( "Birthday" ) );
194 if ( date.isValid() ) 196 if ( date.isValid() )
195 adr.setBirthday( date ); 197 adr.setBirthday( (QDateTime)date );
196 198
197 adr.setRole( el.attribute( "JobTitle" ) ); 199 adr.setRole( el.attribute( "JobTitle" ) );
198 if ( !el.attribute( "FileAs" ).isEmpty() ) 200 if ( !el.attribute( "FileAs" ).isEmpty() )
@@ -317,7 +319,7 @@ bool QtopiaConverter::qtopiaToAddressee( const QDomElement& el, Addressee &adr )
317 return true; 319 return true;
318} 320}
319 321
320bool QtopiaConverter::addresseeToQtopia( const Addressee &ab, QTextStream *stream ) 322bool QtopiaConverter::addresseeToQtopia( const Addressee &ab, Q3TextStream *stream )
321{ 323{
322 *stream << "<Contact "; 324 *stream << "<Contact ";
323 *stream << "FirstName=\"" << escape(ab.givenName()) << "\" "; 325 *stream << "FirstName=\"" << escape(ab.givenName()) << "\" ";
@@ -484,13 +486,13 @@ CategoryEdit::~CategoryEdit(){
484void CategoryEdit::save(const QString& fileName)const{ 486void CategoryEdit::save(const QString& fileName)const{
485 QFile file( fileName ); 487 QFile file( fileName );
486 QString endl = "\n"; 488 QString endl = "\n";
487 if ( file.open( IO_WriteOnly ) ) { 489 if ( file.open( QIODevice::WriteOnly ) ) {
488 QTextStream stream( &file ); 490 Q3TextStream stream( &file );
489 stream.setEncoding( QTextStream::UnicodeUTF8 ); 491 stream.setEncoding( Q3TextStream::UnicodeUTF8 );
490 stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl; 492 stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
491 stream << "<!DOCTYPE CategoryList>" << endl; 493 stream << "<!DOCTYPE CategoryList>" << endl;
492 stream << "<Categories>" << endl; 494 stream << "<Categories>" << endl;
493 for ( QValueList<OpieCategories>::ConstIterator it = m_categories.begin(); 495 for ( Q3ValueList<OpieCategories>::ConstIterator it = m_categories.begin();
494 it != m_categories.end(); ++it ) 496 it != m_categories.end(); ++it )
495 { 497 {
496 stream << "<Category id=\""<< ( (*it).id() ) << "\" "; 498 stream << "<Category id=\""<< ( (*it).id() ) << "\" ";
@@ -537,7 +539,7 @@ void CategoryEdit::parse( const QString &tempFile ){
537 539
538 QDomDocument doc( "mydocument" ); 540 QDomDocument doc( "mydocument" );
539 QFile f( tempFile ); 541 QFile f( tempFile );
540 if ( !f.open( IO_ReadOnly ) ) 542 if ( !f.open( QIODevice::ReadOnly ) )
541 return; 543 return;
542 544
543 if ( !doc.setContent( &f ) ) { 545 if ( !doc.setContent( &f ) ) {
@@ -587,7 +589,7 @@ void CategoryEdit::clear()
587} 589}
588QString CategoryEdit::categoryById( const QString &id, const QString &app )const 590QString CategoryEdit::categoryById( const QString &id, const QString &app )const
589{ 591{
590 QValueList<OpieCategories>::ConstIterator it; 592 Q3ValueList<OpieCategories>::ConstIterator it;
591 QString category; 593 QString category;
592 QString fallback; 594 QString fallback;
593 for( it = m_categories.begin(); it != m_categories.end(); ++it ){ 595 for( it = m_categories.begin(); it != m_categories.end(); ++it ){