summaryrefslogtreecommitdiffabout
path: root/kabc/vcardparser/vcardtool.cpp
Side-by-side diff
Diffstat (limited to 'kabc/vcardparser/vcardtool.cpp') (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
@@ -100,15 +100,26 @@ QString VCardTool::createVCards( Addressee::List list, VCard::Version version )
VCardLine labelLine( "LABEL", (*it).label() );
bool hasLabel = !(*it).label().isEmpty();
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() );
+ }
+ }
}
}
card.addLine( adrLine );
if ( hasLabel )
card.addLine( labelLine );
@@ -230,13 +241,16 @@ QString VCardTool::createVCards( Addressee::List list, VCard::Version version )
for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) {
VCardLine line( "TEL", (*phoneIt).number() );
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 );
}
// TITLE