summaryrefslogtreecommitdiffabout
path: root/kabc/vcardformatimpl.cpp
Side-by-side diff
Diffstat (limited to 'kabc/vcardformatimpl.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kabc/vcardformatimpl.cpp48
1 files changed, 26 insertions, 22 deletions
diff --git a/kabc/vcardformatimpl.cpp b/kabc/vcardformatimpl.cpp
index f90f813..3fcaf94 100644
--- a/kabc/vcardformatimpl.cpp
+++ b/kabc/vcardformatimpl.cpp
@@ -524,15 +524,17 @@ int VCardFormatImpl::readAddressParam( ContentLine *cl )
int type = 0;
ParamList params = cl->paramList();
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;
}
}
return type;
@@ -601,22 +603,24 @@ PhoneNumber VCardFormatImpl::readTelephoneValue( ContentLine *cl )
int type = 0;
ParamList params = cl->paramList();
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;
}
}
p.setType( type );