summaryrefslogtreecommitdiffabout
Side-by-side diff
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,3 +1,3 @@
TEMPLATE = lib
-INCLUDEPATH += . ../.. ../../../microkde ../../../microkde/kdecore $(QPEDIR)/include $(OPIEDIR)/include
+INCLUDEPATH += . ../.. ../../../microkde ../../../microkde/kdecore $(OPIEDIR)/include $(OPEDIR)/include
#CONFIG += staticlib
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
@@ -36,2 +36,3 @@ bool VCardFormatPlugin2::load( Addressee &addressee, QFile *file )
{
+ qDebug("VCardFormatPlugin2::load");
QString data;
@@ -56,2 +57,3 @@ bool VCardFormatPlugin2::loadAll( AddressBook *addressBook, Resource *resource,
{
+ qDebug("VCardFormatPlugin2::loadAll");
QString data;
@@ -79,2 +81,3 @@ void VCardFormatPlugin2::save( const Addressee &addressee, QFile *file )
{
+ qDebug("VCardFormatPlugin2::save");
VCardTool tool;
@@ -92,2 +95,3 @@ void VCardFormatPlugin2::saveAll( AddressBook *ab, Resource *resource, QFile *fi
{
+ qDebug("VCardFormatPlugin2::saveAll");
VCardTool tool;
diff --git a/kabc/vcardformatimpl.cpp b/kabc/vcardformatimpl.cpp
index f90f813..3fcaf94 100644
--- a/kabc/vcardformatimpl.cpp
+++ b/kabc/vcardformatimpl.cpp
@@ -526,11 +526,13 @@ int VCardFormatImpl::readAddressParam( ContentLine *cl )
ParamListIterator it( params );
+ QCString tmpStr;
for( ; it.current(); ++it ) {
- if ( (*it)->name() == "TYPE" ) {
- if ( (*it)->value() == "dom" ) type |= Address::Dom;
- else if ( (*it)->value() == "intl" ) type |= Address::Intl;
- else if ( (*it)->value() == "parcel" ) type |= Address::Parcel;
- else if ( (*it)->value() == "postal" ) type |= Address::Postal;
- else if ( (*it)->value() == "work" ) type |= Address::Work;
- else if ( (*it)->value() == "home" ) type |= Address::Home;
- else if ( (*it)->value() == "pref" ) type |= Address::Pref;
+ if ( (*it)->name().upper() == "TYPE" ) {
+ tmpStr = (*it)->value().lower();
+ if ( tmpStr == "dom" ) type |= Address::Dom;
+ else if ( tmpStr == "intl" ) type |= Address::Intl;
+ else if ( tmpStr == "parcel" ) type |= Address::Parcel;
+ else if ( tmpStr == "postal" ) type |= Address::Postal;
+ else if ( tmpStr == "work" ) type |= Address::Work;
+ else if ( tmpStr == "home" ) type |= Address::Home;
+ else if ( tmpStr == "pref" ) type |= Address::Pref;
}
@@ -603,18 +605,20 @@ PhoneNumber VCardFormatImpl::readTelephoneValue( ContentLine *cl )
ParamListIterator it( params );
+ QCString tmpStr;
for( ; it.current(); ++it ) {
if ( (*it)->name() == "TYPE" ) {
- if ( (*it)->value() == "home" ) type |= PhoneNumber::Home;
- else if ( (*it)->value() == "work" ) type |= PhoneNumber::Work;
- else if ( (*it)->value() == "msg" ) type |= PhoneNumber::Msg;
- else if ( (*it)->value() == "pref" ) type |= PhoneNumber::Pref;
- else if ( (*it)->value() == "voice" ) type |= PhoneNumber::Voice;
- else if ( (*it)->value() == "fax" ) type |= PhoneNumber::Fax;
- else if ( (*it)->value() == "cell" ) type |= PhoneNumber::Cell;
- else if ( (*it)->value() == "video" ) type |= PhoneNumber::Video;
- else if ( (*it)->value() == "bbs" ) type |= PhoneNumber::Bbs;
- else if ( (*it)->value() == "modem" ) type |= PhoneNumber::Modem;
- else if ( (*it)->value() == "car" ) type |= PhoneNumber::Car;
- else if ( (*it)->value() == "isdn" ) type |= PhoneNumber::Isdn;
- else if ( (*it)->value() == "pcs" ) type |= PhoneNumber::Pcs;
- else if ( (*it)->value() == "pager" ) type |= PhoneNumber::Pager;
+ tmpStr = (*it)->value().lower();
+ if ( tmpStr == "home" ) type |= PhoneNumber::Home;
+ else if ( tmpStr == "work" ) type |= PhoneNumber::Work;
+ else if ( tmpStr == "msg" ) type |= PhoneNumber::Msg;
+ else if ( tmpStr == "pref" ) type |= PhoneNumber::Pref;
+ else if ( tmpStr == "voice" ) type |= PhoneNumber::Voice;
+ else if ( tmpStr == "fax" ) type |= PhoneNumber::Fax;
+ else if ( tmpStr == "cell" ) type |= PhoneNumber::Cell;
+ else if ( tmpStr == "video" ) type |= PhoneNumber::Video;
+ else if ( tmpStr == "bbs" ) type |= PhoneNumber::Bbs;
+ else if ( tmpStr == "modem" ) type |= PhoneNumber::Modem;
+ else if ( tmpStr == "car" ) type |= PhoneNumber::Car;
+ else if ( tmpStr == "isdn" ) type |= PhoneNumber::Isdn;
+ else if ( tmpStr == "pcs" ) type |= PhoneNumber::Pcs;
+ else if ( tmpStr == "pager" ) type |= PhoneNumber::Pager;
}
diff --git a/kabc/vcardformatplugin.cpp b/kabc/vcardformatplugin.cpp
index 3cba59a..bc18690 100644
--- a/kabc/vcardformatplugin.cpp
+++ b/kabc/vcardformatplugin.cpp
@@ -37,2 +37,3 @@ bool VCardFormatPlugin::load( Addressee &addressee, QFile *file )
{
+ qDebug("VCardFormatPlugin::load");
return mImpl->load( addressee, file );
@@ -42,2 +43,3 @@ bool VCardFormatPlugin::loadAll( AddressBook *addressBook, Resource *resource, Q
{
+ qDebug("VCardFormatPlugin::loadAll");
return mImpl->loadAll( addressBook, resource, file );
@@ -47,2 +49,3 @@ void VCardFormatPlugin::save( const Addressee &addressee, QFile *file )
{
+ qDebug("VCardFormatPlugin::save");
mImpl->save( addressee, file );
@@ -52,2 +55,3 @@ void VCardFormatPlugin::saveAll( AddressBook *addressBook, Resource *resource, Q
{
+ qDebug("VCardFormatPlugin::saveAll");
mImpl->saveAll( addressBook, resource, file );
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
@@ -105,5 +105,16 @@ QString VCardTool::createVCards( Addressee::List list, VCard::Version version )
if ( typeIt.data() & (*it).type() ) {
- adrLine.addParameter( "TYPE", typeIt.key() );
- if ( hasLabel )
- labelLine.addParameter( "TYPE", typeIt.key() );
+ if ( version == VCard::v3_0 ) {
+ adrLine.addParameter( "TYPE", typeIt.key().lower() );
+ }
+ else {
+ adrLine.addParameter( "TYPE", typeIt.key() );
+ }
+ if ( hasLabel ) {
+ if ( version == VCard::v3_0 ) {
+ labelLine.addParameter( "TYPE", typeIt.key().lower() );
+ }
+ else {
+ labelLine.addParameter( "TYPE", typeIt.key() );
+ }
+ }
}
@@ -235,3 +246,6 @@ QString VCardTool::createVCards( Addressee::List list, VCard::Version version )
if ( typeIt.data() & (*phoneIt).type() )
- line.addParameter( "TYPE", typeIt.key() );
+ if ( version == VCard::v3_0 )
+ line.addParameter( "TYPE", typeIt.key().lower() );
+ else
+ line.addParameter( "TYPE", typeIt.key() );
}