author | ulf69 <ulf69> | 2004-07-09 08:10:08 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-07-09 08:10:08 (UTC) |
commit | de99e22a7093e857ee3c08a67ccc389d6374099a (patch) (side-by-side diff) | |
tree | 511c309f9df3ae71d43c194cc41f27bdb1966a05 /kabc/vcardparser | |
parent | d56bb523048598245ac4ffcb16689687e082f831 (diff) | |
download | kdepimpi-de99e22a7093e857ee3c08a67ccc389d6374099a.zip kdepimpi-de99e22a7093e857ee3c08a67ccc389d6374099a.tar.gz kdepimpi-de99e22a7093e857ee3c08a67ccc389d6374099a.tar.bz2 |
support of caseinsensitive phone and adress types, as required by the vcard spec
-rw-r--r-- | kabc/vcardparser/vcardtool.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
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 @@ -103,9 +103,20 @@ QString VCardTool::createVCards( Addressee::List list, VCard::Version version ) QMap<QString, int>::Iterator typeIt; for ( typeIt = mAddressTypeMap.begin(); typeIt != mAddressTypeMap.end(); ++typeIt ) { 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() ); + } + } } } @@ -233,7 +244,10 @@ QString VCardTool::createVCards( Addressee::List list, VCard::Version version ) QMap<QString, int>::Iterator typeIt; for ( typeIt = mPhoneTypeMap.begin(); typeIt != mPhoneTypeMap.end(); ++typeIt ) { 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() ); } card.addLine( line ); |