summaryrefslogtreecommitdiffabout
authorulf69 <ulf69>2004-07-13 15:04:53 (UTC)
committer ulf69 <ulf69>2004-07-13 15:04:53 (UTC)
commitf88d48384d2c012fbaa3ffaa613d6eaa3694fab7 (patch) (unidiff)
treec96af4b67257a2a2021ba0601042ce77aff9d69d
parent2450dd81505b6212ec5bf59c168b53c52bd08f53 (diff)
downloadkdepimpi-f88d48384d2c012fbaa3ffaa613d6eaa3694fab7.zip
kdepimpi-f88d48384d2c012fbaa3ffaa613d6eaa3694fab7.tar.gz
kdepimpi-f88d48384d2c012fbaa3ffaa613d6eaa3694fab7.tar.bz2
intial implementation of the qtopia converter
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile.Embedded16
-rw-r--r--kabc/converter/qtopia/qtopiaE.pro12
-rw-r--r--kabc/converter/qtopia/qtopiaconverter.cpp52
-rw-r--r--kabc/converter/qtopia/qtopiaconverter.h4
4 files changed, 49 insertions, 35 deletions
diff --git a/Makefile.Embedded b/Makefile.Embedded
index aaba10a..3160017 100644
--- a/Makefile.Embedded
+++ b/Makefile.Embedded
@@ -4,3 +4,4 @@ DISTDIR = $(shell basename $(DISTPATH))
4SUBDIRS = libical/src/libical libical/src/libicalss qtcompat microkde \ 4SUBDIRS = libical/src/libical libical/src/libicalss qtcompat microkde \
5 libkcal libkdepim kabc kabc/converter/opie kabc/formats/binary kabc/plugins/file kabc/plugins/dir \ 5 libkcal libkdepim kabc kabc/converter/opie kabc/converter/qtopia kabc/formats/binary \
6 kabc/plugins/file kabc/plugins/dir \
6 kabc/plugins/ldap kabc/plugins/opie kabc/plugins/qtopia \ 7 kabc/plugins/ldap kabc/plugins/opie kabc/plugins/qtopia \
@@ -43,2 +44,3 @@ tmake: objects qtcompat/Makefile$(PLATFORM) microkde/Makefile$(PLATFORM) \
43 kabc/converter/opie/Makefile$(PLATFORM) \ 44 kabc/converter/opie/Makefile$(PLATFORM) \
45 kabc/converter/qtopia/Makefile$(PLATFORM) \
44 kabc/formats/binary/Makefile$(PLATFORM) \ 46 kabc/formats/binary/Makefile$(PLATFORM) \
@@ -48,3 +50,4 @@ tmake: objects qtcompat/Makefile$(PLATFORM) microkde/Makefile$(PLATFORM) \
48 kabc/plugins/opie/Makefile$(PLATFORM) \ 50 kabc/plugins/opie/Makefile$(PLATFORM) \
49 kabc/plugins/qtopia/Makefile$(PLATFORM) kaddressbook/xxport/opie/Makefile$(PLATFORM) \ 51 kabc/plugins/qtopia/Makefile$(PLATFORM) \
52 kaddressbook/xxport/opie/Makefile$(PLATFORM) \
50 kaddressbook/Makefile$(PLATFORM) 53 kaddressbook/Makefile$(PLATFORM)
@@ -81,5 +84,8 @@ kabc/Makefile$(PLATFORM): kabc/kabcE.pro
81 84
82kabc/converter/opie/Makefile$(PLATFORM): kabc/converter/opie/opieconverterE.pro 85kabc/converter/opie/Makefile$(PLATFORM): kabc/converter/opie/opieE.pro
83 cd kabc/converter/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" opieconverterE.pro -o Makefile$(PLATFORM) 86 cd kabc/converter/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" opieE.pro -o Makefile$(PLATFORM)
84 87
88kabc/converter/qtopia/Makefile$(PLATFORM): kabc/converter/qtopia/qtopiaE.pro
89 cd kabc/converter/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" qtopiaE.pro -o Makefile$(PLATFORM)
90
85kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro 91kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro
diff --git a/kabc/converter/qtopia/qtopiaE.pro b/kabc/converter/qtopia/qtopiaE.pro
index e026f2a..4241b8b 100644
--- a/kabc/converter/qtopia/qtopiaE.pro
+++ b/kabc/converter/qtopia/qtopiaE.pro
@@ -1,3 +1,3 @@
1TEMPLATE = lib 1TEMPLATE = lib
2INCLUDEPATH += . ../.. ../../../microkde ../../../microkde/kdecore $(OPIEDIR)/include $(OPEDIR)/include 2INCLUDEPATH += . ../.. ../../../microkde ../../../microkde/kdecore $(QPEDIR)/include
3#CONFIG += staticlib 3#CONFIG += staticlib
@@ -16,8 +16,6 @@ LIBS += -L$(QPEDIR)/lib
16LIBS += -L$(OPIEDIR)/lib 16LIBS += -L$(OPIEDIR)/lib
17LIBS += -lopie 17LIBS += -lqpepim
18LIBS += -lqpe 18LIBS += -lqpe
19LIBS += -lqte
20 19
21 20TARGET = microkabc_qtopiaconverter
22TARGET = microkabc_opieconverter
23 21
@@ -26,3 +24,3 @@ TARGET = microkabc_opieconverter
26HEADERS += \ 24HEADERS += \
27 opieconverter.h \ 25 qtopiaconverter.h \
28 26
@@ -30,3 +28,3 @@ HEADERS += \
30SOURCES += \ 28SOURCES += \
31 opieconverter.cpp \ 29 qtopiaconverter.cpp \
32 30
diff --git a/kabc/converter/qtopia/qtopiaconverter.cpp b/kabc/converter/qtopia/qtopiaconverter.cpp
index 7aa76fe..e3dd3e6 100644
--- a/kabc/converter/qtopia/qtopiaconverter.cpp
+++ b/kabc/converter/qtopia/qtopiaconverter.cpp
@@ -33,3 +33,3 @@ $Id$
33 33
34//US #include <qpe/categories.h> 34#include <qpe/categories.h>
35//US #include <qpe/categoryselect.h> 35//US #include <qpe/categoryselect.h>
@@ -50,3 +50,2 @@ bool QtopiaConverter::init()
50{ 50{
51/*US
52 catDB = new Categories(); 51 catDB = new Categories();
@@ -61,4 +60,2 @@ bool QtopiaConverter::init()
61 } 60 }
62*/
63return true;
64} 61}
@@ -67,3 +64,2 @@ void QtopiaConverter::deinit()
67{ 64{
68/*US
69 if (catDB) 65 if (catDB)
@@ -73,3 +69,2 @@ void QtopiaConverter::deinit()
73 } 69 }
74*/
75} 70}
@@ -83,3 +78,3 @@ bool QtopiaConverter::qtopiaToAddressee( const PimContact &contact, Addressee &a
83 addr.setAdditionalName( contact.middleName() ); 78 addr.setAdditionalName( contact.middleName() );
84 addr.setPrefix( contact.title() ); 79 addr.setPrefix( contact.nameTitle() );
85 addr.setSuffix( contact.suffix() ); 80 addr.setSuffix( contact.suffix() );
@@ -206,4 +201,9 @@ bool QtopiaConverter::qtopiaToAddressee( const PimContact &contact, Addressee &a
206 addr.insertCustom( "KADDRESSBOOK", "X-SpousesName", contact.spouse() ); 201 addr.insertCustom( "KADDRESSBOOK", "X-SpousesName", contact.spouse() );
207 addr.insertCustom( "KADDRESSBOOK", "X-Gender", contact.gender() ); 202 // qtopia uses this categorization:
208 203 // enum GenderType { UnspecifiedGender=0, Male, Female };
204 if (contact.gender() == PimContact::Male)
205 addr.insertCustom( "KADDRESSBOOK", "X-Gender", "male");
206 else if (contact.gender() == PimContact::Female)
207 addr.insertCustom( "KADDRESSBOOK", "X-Gender", "female");
208
209 if (contact.anniversary().isValid()) { 209 if (contact.anniversary().isValid()) {
@@ -233,8 +233,10 @@ bool QtopiaConverter::qtopiaToAddressee( const PimContact &contact, Addressee &a
233 233
234 234 QArray<int> catArray = contact.categories();
235 QStringList cats = contact.categoryNames("Contacts"); 235 QString cat;
236 addr.setCategories( cats ); 236
237// for ( QStringList::Iterator it = cats.begin(); it != cats.end(); ++it ) { 237 for ( unsigned int i=0; i < catArray.size(); i++ ) {
238// qDebug("Cat: %s", (*it).latin1()); 238 cat = catDB->label("contact", catArray[i]);
239// } 239 if ( !cat.isEmpty() )
240 addr.insertCategory( cat );
241 }
240 242
@@ -249,3 +251,3 @@ bool QtopiaConverter::addresseeToQtopia( const Addressee &addr, PimContact &cont
249 contact.setMiddleName(addr.additionalName()); 251 contact.setMiddleName(addr.additionalName());
250 contact.setTitle(addr.prefix()); 252 contact.setNameTitle(addr.prefix());
251 contact.setSuffix(addr.suffix()); 253 contact.setSuffix(addr.suffix());
@@ -324,4 +326,13 @@ bool QtopiaConverter::addresseeToQtopia( const Addressee &addr, PimContact &cont
324 contact.setSpouse(addr.custom( "KADDRESSBOOK", "X-Spouse" )); 326 contact.setSpouse(addr.custom( "KADDRESSBOOK", "X-Spouse" ));
325 contact.setGender(addr.custom( "KADDRESSBOOK", "X-Gender" )); 327 // qtopia uses this categorization:
326 328 // enum GenderType { UnspecifiedGender=0, Male, Female };
329 QString gt = addr.custom( "KADDRESSBOOK", "X-Gender" );
330 if (gt = "male")
331 contact.setGender(PimContact::Male);
332 else if (gt = "female")
333 contact.setGender(PimContact::Female);
334 else
335 contact.setGender(PimContact::UnspecifiedGender);
336
337
327 QDate dt = KGlobal::locale()->readDate( 338 QDate dt = KGlobal::locale()->readDate(
@@ -342,3 +353,2 @@ bool QtopiaConverter::addresseeToQtopia( const Addressee &addr, PimContact &cont
342 353
343/*US
344 QStringList cats = addr.categories(); 354 QStringList cats = addr.categories();
@@ -347,6 +357,6 @@ bool QtopiaConverter::addresseeToQtopia( const Addressee &addr, PimContact &cont
347 if ( !cats.isEmpty() ) { 357 if ( !cats.isEmpty() ) {
348 QArray<int> iar = catDB.ids("contact", cats); 358 QArray<int> iar = catDB->ids("contact", cats);
349 contact.setCategories(iar); 359 contact.setCategories(iar);
350 } 360 }
351*/ 361
352 return true; 362 return true;
diff --git a/kabc/converter/qtopia/qtopiaconverter.h b/kabc/converter/qtopia/qtopiaconverter.h
index aaa267a..7397113 100644
--- a/kabc/converter/qtopia/qtopiaconverter.h
+++ b/kabc/converter/qtopia/qtopiaconverter.h
@@ -34,3 +34,3 @@ $Id$
34 34
35//US class Categories; 35class Categories;
36 36
@@ -72,3 +72,3 @@ public:
72 private: 72 private:
73//US Categories* catDB; 73 Categories* catDB;
74 74