summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/qtopia
Unidiff
Diffstat (limited to 'kabc/plugins/qtopia') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/qtopia/qtopia.pro16
-rw-r--r--kabc/plugins/qtopia/qtopiaE.pro6
-rw-r--r--kabc/plugins/qtopia/qtopiaconverter.cpp24
-rw-r--r--kabc/plugins/qtopia/qtopiaconverter.h9
-rw-r--r--kabc/plugins/qtopia/resourceqtopia.cpp14
-rw-r--r--kabc/plugins/qtopia/resourceqtopiaconfig.cpp4
6 files changed, 42 insertions, 31 deletions
diff --git a/kabc/plugins/qtopia/qtopia.pro b/kabc/plugins/qtopia/qtopia.pro
index 64d1abc..d91a2e3 100644
--- a/kabc/plugins/qtopia/qtopia.pro
+++ b/kabc/plugins/qtopia/qtopia.pro
@@ -3,13 +3,13 @@ CONFIG += qt warn_on release
3 3
4include( ../../../variables.pri ) 4include( ../../../variables.pri )
5 5
6TARGET = microkabc_qtopia 6TARGET = xmicrokabc_qtopia
7 7
8INCLUDEPATH += ../.. ../../.. ../../../kabc ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources 8INCLUDEPATH += ../.. ../../.. ../../../kabc ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources
9 9
10DESTDIR = ../../../bin 10DESTDIR = ../../../bin
11#LIBS += -lmicrokde 11#LIBS += -lxmicrokde
12#LIBS += -lkamicrokabc 12#LIBS += -lxkamicrokabc
13 13
14DEFINES += KAB_EMBEDDED DESKTOP_VERSION 14DEFINES += KAB_EMBEDDED DESKTOP_VERSION
15 15
@@ -36,8 +36,12 @@ CONFIG += dll
36DEFINES += _WIN32_ 36DEFINES += _WIN32_
37OBJECTS_DIR = obj/win 37OBJECTS_DIR = obj/win
38MOC_DIR = moc/win 38MOC_DIR = moc/win
39LIBS += ../../../bin/microkdepim.lib 39LIBS += ../../../bin/xmicrokdepim.lib
40LIBS += ../../../bin/microkcal.lib 40LIBS += ../../../bin/xmicrokcal.lib
41LIBS += ../../../bin/microkde.lib 41LIBS += ../../../bin/xmicrokde.lib
42LIBS += ../../../bin/microkabc.lib 42LIBS += ../../../bin/microkabc.lib
43} 43}
44#The following line was inserted by qt3to4
45QT += xml qt3support
46#The following line was inserted by qt3to4
47QT +=
diff --git a/kabc/plugins/qtopia/qtopiaE.pro b/kabc/plugins/qtopia/qtopiaE.pro
index 700057b..4b174b2 100644
--- a/kabc/plugins/qtopia/qtopiaE.pro
+++ b/kabc/plugins/qtopia/qtopiaE.pro
@@ -1,15 +1,15 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2CONFIG += qt warn_on 2CONFIG += qt warn_on
3 3
4TARGET = microkabc_qtopia 4TARGET = xmicrokabc_qtopia
5 5
6INCLUDEPATH += $(KDEPIMDIR) $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat $(QPEDIR)/include 6INCLUDEPATH += $(KDEPIMDIR) $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat $(QPEDIR)/include
7 7
8OBJECTS_DIR = obj/$(PLATFORM) 8OBJECTS_DIR = obj/$(PLATFORM)
9MOC_DIR = moc/$(PLATFORM) 9MOC_DIR = moc/$(PLATFORM)
10DESTDIR = $(QPEDIR)/lib 10DESTDIR = $(QPEDIR)/lib
11LIBS += -lmicrokde 11LIBS += -lxmicrokde
12LIBS += -lmicrokabc 12LIBS += -lxmicrokabc
13LIBS += -L$(QPEDIR)/lib 13LIBS += -L$(QPEDIR)/lib
14LIBS += -lqpe 14LIBS += -lqpe
15 15
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 ){
diff --git a/kabc/plugins/qtopia/qtopiaconverter.h b/kabc/plugins/qtopia/qtopiaconverter.h
index 744dd41..389926c 100644
--- a/kabc/plugins/qtopia/qtopiaconverter.h
+++ b/kabc/plugins/qtopia/qtopiaconverter.h
@@ -28,6 +28,9 @@ $Id$
28#define KABC_QTOPIACONVERTER_H 28#define KABC_QTOPIACONVERTER_H
29 29
30#include <qstring.h> 30#include <qstring.h>
31//Added by qt3to4:
32#include <Q3ValueList>
33#include <Q3TextStream>
31 34
32#include "addressee.h" 35#include "addressee.h"
33#ifdef DESKTOP_VERSION 36#ifdef DESKTOP_VERSION
@@ -76,14 +79,14 @@ class OpieCategories {
76 QStringList categoriesByIds( const QStringList& ids, const QString& app ); 79 QStringList categoriesByIds( const QStringList& ids, const QString& app );
77 80
78 void clear(); 81 void clear();
79 QValueList<OpieCategories> categories()const { return m_categories; }; 82 Q3ValueList<OpieCategories> categories()const { return m_categories; };
80 private: 83 private:
81 /** 84 /**
82 * this function will be used internally to update the kde categories... 85 * this function will be used internally to update the kde categories...
83 */ 86 */
84 void updateKDE( const QString& app, const QStringList& categories ); 87 void updateKDE( const QString& app, const QStringList& categories );
85 QMap<int, bool> ids; // from tt Qtopia::UidGen 88 QMap<int, bool> ids; // from tt Qtopia::UidGen
86 QValueList<OpieCategories> m_categories; 89 Q3ValueList<OpieCategories> m_categories;
87 }; 90 };
88 91
89 92
@@ -117,7 +120,7 @@ public:
117 * @param addr The addressee. 120 * @param addr The addressee.
118 * @param contact The qtopia contact. 121 * @param contact The qtopia contact.
119 */ 122 */
120 bool addresseeToQtopia( const Addressee &ab, QTextStream *stream ); 123 bool addresseeToQtopia( const Addressee &ab, Q3TextStream *stream );
121 124
122 private: 125 private:
123 QString categoriesToNumber( const QStringList &list, const QString &app ); 126 QString categoriesToNumber( const QStringList &list, const QString &app );
diff --git a/kabc/plugins/qtopia/resourceqtopia.cpp b/kabc/plugins/qtopia/resourceqtopia.cpp
index 79ddaea..a36eb8f 100644
--- a/kabc/plugins/qtopia/resourceqtopia.cpp
+++ b/kabc/plugins/qtopia/resourceqtopia.cpp
@@ -31,7 +31,7 @@ $Id$
31#endif 31#endif
32#include <qdir.h> 32#include <qdir.h>
33#include <qfile.h> 33#include <qfile.h>
34#include <qtextstream.h> 34#include <q3textstream.h>
35#include <qfileinfo.h> 35#include <qfileinfo.h>
36#include <qregexp.h> 36#include <qregexp.h>
37//US #include <qtimer.h> 37//US #include <qtimer.h>
@@ -156,7 +156,7 @@ bool ResourceQtopia::load()
156{ 156{
157 157
158 QFile file( fileName() ); 158 QFile file( fileName() );
159 if ( !file.open(IO_ReadOnly ) ) { 159 if ( !file.open(QIODevice::ReadOnly ) ) {
160 return false; 160 return false;
161 } 161 }
162 162
@@ -203,12 +203,12 @@ bool ResourceQtopia::save( Ticket *ticket )
203 KABC::AddressBook::Iterator it; 203 KABC::AddressBook::Iterator it;
204 bool res; 204 bool res;
205 QFile file( fileName() ); 205 QFile file( fileName() );
206 if (!file.open( IO_WriteOnly ) ) { 206 if (!file.open( QIODevice::WriteOnly ) ) {
207 return false; 207 return false;
208 } 208 }
209 QTextStream ts( &file ); 209 Q3TextStream ts( &file );
210 QTextStream *stream = &ts; 210 Q3TextStream *stream = &ts;
211 stream->setEncoding( QTextStream::UnicodeUTF8 ); 211 stream->setEncoding( Q3TextStream::UnicodeUTF8 );
212 *stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE Addressbook ><AddressBook>" << endl; 212 *stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE Addressbook ><AddressBook>" << endl;
213 *stream << " <Groups>" << endl; 213 *stream << " <Groups>" << endl;
214 *stream << " </Groups>" << endl; 214 *stream << " </Groups>" << endl;
@@ -260,7 +260,7 @@ bool ResourceQtopia::lock( const QString &lockfileName )
260 260
261 // Create unique file 261 // Create unique file
262 QFile file( mLockUniqueName ); 262 QFile file( mLockUniqueName );
263 file.open( IO_WriteOnly ); 263 file.open( QIODevice::WriteOnly );
264 file.close(); 264 file.close();
265 265
266 // Create lock file 266 // Create lock file
diff --git a/kabc/plugins/qtopia/resourceqtopiaconfig.cpp b/kabc/plugins/qtopia/resourceqtopiaconfig.cpp
index d5d6141..42fd428 100644
--- a/kabc/plugins/qtopia/resourceqtopiaconfig.cpp
+++ b/kabc/plugins/qtopia/resourceqtopiaconfig.cpp
@@ -27,6 +27,8 @@ $Id$
27 27
28#include <qlabel.h> 28#include <qlabel.h>
29#include <qlayout.h> 29#include <qlayout.h>
30//Added by qt3to4:
31#include <Q3GridLayout>
30 32
31#include <kdebug.h> 33#include <kdebug.h>
32#include <klocale.h> 34#include <klocale.h>
@@ -46,7 +48,7 @@ using namespace KABC;
46ResourceQtopiaConfig::ResourceQtopiaConfig( QWidget* parent, const char* name ) 48ResourceQtopiaConfig::ResourceQtopiaConfig( QWidget* parent, const char* name )
47 : ConfigWidget( parent, name ) 49 : ConfigWidget( parent, name )
48{ 50{
49 QGridLayout *mainLayout = new QGridLayout( this, 1, 2, 0, 51 Q3GridLayout *mainLayout = new Q3GridLayout( this, 1, 2, 0,
50 KDialog::spacingHint() ); 52 KDialog::spacingHint() );
51 53
52 QLabel *label = new QLabel( i18n( "Location:" ), this ); 54 QLabel *label = new QLabel( i18n( "Location:" ), this );