summaryrefslogtreecommitdiffabout
path: root/kabc/vcardparser
authorulf69 <ulf69>2004-07-09 08:10:08 (UTC)
committer ulf69 <ulf69>2004-07-09 08:10:08 (UTC)
commitde99e22a7093e857ee3c08a67ccc389d6374099a (patch) (unidiff)
tree511c309f9df3ae71d43c194cc41f27bdb1966a05 /kabc/vcardparser
parentd56bb523048598245ac4ffcb16689687e082f831 (diff)
downloadkdepimpi-de99e22a7093e857ee3c08a67ccc389d6374099a.zip
kdepimpi-de99e22a7093e857ee3c08a67ccc389d6374099a.tar.gz
kdepimpi-de99e22a7093e857ee3c08a67ccc389d6374099a.tar.bz2
support of caseinsensitive phone and adress types, as required by the vcard spec
Diffstat (limited to 'kabc/vcardparser') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/vcardparser/vcardtool.cpp22
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 )
103 QMap<QString, int>::Iterator typeIt; 103 QMap<QString, int>::Iterator typeIt;
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 }
111 122
@@ -233,7 +244,10 @@ QString VCardTool::createVCards( Addressee::List list, VCard::Version version )
233 QMap<QString, int>::Iterator typeIt; 244 QMap<QString, int>::Iterator typeIt;
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
239 card.addLine( line ); 253 card.addLine( line );