summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/converter/opie/opieconverterE.pro2
-rw-r--r--kabc/formats/vcardformatplugin2.cpp4
-rw-r--r--kabc/vcardformatimpl.cpp48
-rw-r--r--kabc/vcardformatplugin.cpp4
-rw-r--r--kabc/vcardparser/vcardtool.cpp22
5 files changed, 53 insertions, 27 deletions
diff --git a/kabc/converter/opie/opieconverterE.pro b/kabc/converter/opie/opieconverterE.pro
index 85ba28f..e026f2a 100644
--- a/kabc/converter/opie/opieconverterE.pro
+++ b/kabc/converter/opie/opieconverterE.pro
@@ -1,4 +1,4 @@
1TEMPLATE = lib 1TEMPLATE = lib
2INCLUDEPATH += . ../.. ../../../microkde ../../../microkde/kdecore $(QPEDIR)/include $(OPIEDIR)/include 2INCLUDEPATH += . ../.. ../../../microkde ../../../microkde/kdecore $(OPIEDIR)/include $(OPEDIR)/include
3#CONFIG += staticlib 3#CONFIG += staticlib
4OBJECTS_DIR = obj/$(PLATFORM) 4OBJECTS_DIR = obj/$(PLATFORM)
diff --git a/kabc/formats/vcardformatplugin2.cpp b/kabc/formats/vcardformatplugin2.cpp
index f19e218..41b0c9a 100644
--- a/kabc/formats/vcardformatplugin2.cpp
+++ b/kabc/formats/vcardformatplugin2.cpp
@@ -35,4 +35,5 @@ VCardFormatPlugin2::~VCardFormatPlugin2()
35bool VCardFormatPlugin2::load( Addressee &addressee, QFile *file ) 35bool VCardFormatPlugin2::load( Addressee &addressee, QFile *file )
36{ 36{
37 qDebug("VCardFormatPlugin2::load");
37 QString data; 38 QString data;
38 39
@@ -55,4 +56,5 @@ bool VCardFormatPlugin2::load( Addressee &addressee, QFile *file )
55bool VCardFormatPlugin2::loadAll( AddressBook *addressBook, Resource *resource, QFile *file ) 56bool VCardFormatPlugin2::loadAll( AddressBook *addressBook, Resource *resource, QFile *file )
56{ 57{
58 qDebug("VCardFormatPlugin2::loadAll");
57 QString data; 59 QString data;
58 60
@@ -78,4 +80,5 @@ bool VCardFormatPlugin2::loadAll( AddressBook *addressBook, Resource *resource,
78void VCardFormatPlugin2::save( const Addressee &addressee, QFile *file ) 80void VCardFormatPlugin2::save( const Addressee &addressee, QFile *file )
79{ 81{
82 qDebug("VCardFormatPlugin2::save");
80 VCardTool tool; 83 VCardTool tool;
81 Addressee::List vcardlist; 84 Addressee::List vcardlist;
@@ -91,4 +94,5 @@ void VCardFormatPlugin2::save( const Addressee &addressee, QFile *file )
91void VCardFormatPlugin2::saveAll( AddressBook *ab, Resource *resource, QFile *file ) 94void VCardFormatPlugin2::saveAll( AddressBook *ab, Resource *resource, QFile *file )
92{ 95{
96 qDebug("VCardFormatPlugin2::saveAll");
93 VCardTool tool; 97 VCardTool tool;
94 Addressee::List vcardlist; 98 Addressee::List vcardlist;
diff --git a/kabc/vcardformatimpl.cpp b/kabc/vcardformatimpl.cpp
index f90f813..3fcaf94 100644
--- a/kabc/vcardformatimpl.cpp
+++ b/kabc/vcardformatimpl.cpp
@@ -525,13 +525,15 @@ int VCardFormatImpl::readAddressParam( ContentLine *cl )
525 ParamList params = cl->paramList(); 525 ParamList params = cl->paramList();
526 ParamListIterator it( params ); 526 ParamListIterator it( params );
527 QCString tmpStr;
527 for( ; it.current(); ++it ) { 528 for( ; it.current(); ++it ) {
528 if ( (*it)->name() == "TYPE" ) { 529 if ( (*it)->name().upper() == "TYPE" ) {
529 if ( (*it)->value() == "dom" ) type |= Address::Dom; 530 tmpStr = (*it)->value().lower();
530 else if ( (*it)->value() == "intl" ) type |= Address::Intl; 531 if ( tmpStr == "dom" ) type |= Address::Dom;
531 else if ( (*it)->value() == "parcel" ) type |= Address::Parcel; 532 else if ( tmpStr == "intl" ) type |= Address::Intl;
532 else if ( (*it)->value() == "postal" ) type |= Address::Postal; 533 else if ( tmpStr == "parcel" ) type |= Address::Parcel;
533 else if ( (*it)->value() == "work" ) type |= Address::Work; 534 else if ( tmpStr == "postal" ) type |= Address::Postal;
534 else if ( (*it)->value() == "home" ) type |= Address::Home; 535 else if ( tmpStr == "work" ) type |= Address::Work;
535 else if ( (*it)->value() == "pref" ) type |= Address::Pref; 536 else if ( tmpStr == "home" ) type |= Address::Home;
537 else if ( tmpStr == "pref" ) type |= Address::Pref;
536 } 538 }
537 } 539 }
@@ -602,20 +604,22 @@ PhoneNumber VCardFormatImpl::readTelephoneValue( ContentLine *cl )
602 ParamList params = cl->paramList(); 604 ParamList params = cl->paramList();
603 ParamListIterator it( params ); 605 ParamListIterator it( params );
606 QCString tmpStr;
604 for( ; it.current(); ++it ) { 607 for( ; it.current(); ++it ) {
605 if ( (*it)->name() == "TYPE" ) { 608 if ( (*it)->name() == "TYPE" ) {
606 if ( (*it)->value() == "home" ) type |= PhoneNumber::Home; 609 tmpStr = (*it)->value().lower();
607 else if ( (*it)->value() == "work" ) type |= PhoneNumber::Work; 610 if ( tmpStr == "home" ) type |= PhoneNumber::Home;
608 else if ( (*it)->value() == "msg" ) type |= PhoneNumber::Msg; 611 else if ( tmpStr == "work" ) type |= PhoneNumber::Work;
609 else if ( (*it)->value() == "pref" ) type |= PhoneNumber::Pref; 612 else if ( tmpStr == "msg" ) type |= PhoneNumber::Msg;
610 else if ( (*it)->value() == "voice" ) type |= PhoneNumber::Voice; 613 else if ( tmpStr == "pref" ) type |= PhoneNumber::Pref;
611 else if ( (*it)->value() == "fax" ) type |= PhoneNumber::Fax; 614 else if ( tmpStr == "voice" ) type |= PhoneNumber::Voice;
612 else if ( (*it)->value() == "cell" ) type |= PhoneNumber::Cell; 615 else if ( tmpStr == "fax" ) type |= PhoneNumber::Fax;
613 else if ( (*it)->value() == "video" ) type |= PhoneNumber::Video; 616 else if ( tmpStr == "cell" ) type |= PhoneNumber::Cell;
614 else if ( (*it)->value() == "bbs" ) type |= PhoneNumber::Bbs; 617 else if ( tmpStr == "video" ) type |= PhoneNumber::Video;
615 else if ( (*it)->value() == "modem" ) type |= PhoneNumber::Modem; 618 else if ( tmpStr == "bbs" ) type |= PhoneNumber::Bbs;
616 else if ( (*it)->value() == "car" ) type |= PhoneNumber::Car; 619 else if ( tmpStr == "modem" ) type |= PhoneNumber::Modem;
617 else if ( (*it)->value() == "isdn" ) type |= PhoneNumber::Isdn; 620 else if ( tmpStr == "car" ) type |= PhoneNumber::Car;
618 else if ( (*it)->value() == "pcs" ) type |= PhoneNumber::Pcs; 621 else if ( tmpStr == "isdn" ) type |= PhoneNumber::Isdn;
619 else if ( (*it)->value() == "pager" ) type |= PhoneNumber::Pager; 622 else if ( tmpStr == "pcs" ) type |= PhoneNumber::Pcs;
623 else if ( tmpStr == "pager" ) type |= PhoneNumber::Pager;
620 } 624 }
621 } 625 }
diff --git a/kabc/vcardformatplugin.cpp b/kabc/vcardformatplugin.cpp
index 3cba59a..bc18690 100644
--- a/kabc/vcardformatplugin.cpp
+++ b/kabc/vcardformatplugin.cpp
@@ -36,4 +36,5 @@ VCardFormatPlugin::~VCardFormatPlugin()
36bool VCardFormatPlugin::load( Addressee &addressee, QFile *file ) 36bool VCardFormatPlugin::load( Addressee &addressee, QFile *file )
37{ 37{
38 qDebug("VCardFormatPlugin::load");
38 return mImpl->load( addressee, file ); 39 return mImpl->load( addressee, file );
39} 40}
@@ -41,4 +42,5 @@ bool VCardFormatPlugin::load( Addressee &addressee, QFile *file )
41bool VCardFormatPlugin::loadAll( AddressBook *addressBook, Resource *resource, QFile *file ) 42bool VCardFormatPlugin::loadAll( AddressBook *addressBook, Resource *resource, QFile *file )
42{ 43{
44 qDebug("VCardFormatPlugin::loadAll");
43 return mImpl->loadAll( addressBook, resource, file ); 45 return mImpl->loadAll( addressBook, resource, file );
44} 46}
@@ -46,4 +48,5 @@ bool VCardFormatPlugin::loadAll( AddressBook *addressBook, Resource *resource, Q
46void VCardFormatPlugin::save( const Addressee &addressee, QFile *file ) 48void VCardFormatPlugin::save( const Addressee &addressee, QFile *file )
47{ 49{
50 qDebug("VCardFormatPlugin::save");
48 mImpl->save( addressee, file ); 51 mImpl->save( addressee, file );
49} 52}
@@ -51,4 +54,5 @@ void VCardFormatPlugin::save( const Addressee &addressee, QFile *file )
51void VCardFormatPlugin::saveAll( AddressBook *addressBook, Resource *resource, QFile *file ) 54void VCardFormatPlugin::saveAll( AddressBook *addressBook, Resource *resource, QFile *file )
52{ 55{
56 qDebug("VCardFormatPlugin::saveAll");
53 mImpl->saveAll( addressBook, resource, file ); 57 mImpl->saveAll( addressBook, resource, file );
54} 58}
diff --git a/kabc/vcardparser/vcardtool.cpp b/kabc/vcardparser/vcardtool.cpp
index 01c5b3e..71f29d7 100644
--- a/kabc/vcardparser/vcardtool.cpp
+++ b/kabc/vcardparser/vcardtool.cpp
@@ -104,7 +104,18 @@ QString VCardTool::createVCards( Addressee::List list, VCard::Version version )
104 for ( typeIt = mAddressTypeMap.begin(); typeIt != mAddressTypeMap.end(); ++typeIt ) { 104 for ( typeIt = mAddressTypeMap.begin(); typeIt != mAddressTypeMap.end(); ++typeIt ) {
105 if ( typeIt.data() & (*it).type() ) { 105 if ( typeIt.data() & (*it).type() ) {
106 adrLine.addParameter( "TYPE", typeIt.key() ); 106 if ( version == VCard::v3_0 ) {
107 if ( hasLabel ) 107 adrLine.addParameter( "TYPE", typeIt.key().lower() );
108 labelLine.addParameter( "TYPE", typeIt.key() ); 108 }
109 else {
110 adrLine.addParameter( "TYPE", typeIt.key() );
111 }
112 if ( hasLabel ) {
113 if ( version == VCard::v3_0 ) {
114 labelLine.addParameter( "TYPE", typeIt.key().lower() );
115 }
116 else {
117 labelLine.addParameter( "TYPE", typeIt.key() );
118 }
119 }
109 } 120 }
110 } 121 }
@@ -234,5 +245,8 @@ QString VCardTool::createVCards( Addressee::List list, VCard::Version version )
234 for ( typeIt = mPhoneTypeMap.begin(); typeIt != mPhoneTypeMap.end(); ++typeIt ) { 245 for ( typeIt = mPhoneTypeMap.begin(); typeIt != mPhoneTypeMap.end(); ++typeIt ) {
235 if ( typeIt.data() & (*phoneIt).type() ) 246 if ( typeIt.data() & (*phoneIt).type() )
236 line.addParameter( "TYPE", typeIt.key() ); 247 if ( version == VCard::v3_0 )
248 line.addParameter( "TYPE", typeIt.key().lower() );
249 else
250 line.addParameter( "TYPE", typeIt.key() );
237 } 251 }
238 252