Diffstat (limited to 'kabc/vcardparser/vcardtool.cpp') (more/less context) (ignore whitespace changes)
-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 | |||
@@ -100,15 +100,26 @@ QString VCardTool::createVCards( Addressee::List list, VCard::Version version ) | |||
100 | VCardLine labelLine( "LABEL", (*it).label() ); | 100 | VCardLine labelLine( "LABEL", (*it).label() ); |
101 | 101 | ||
102 | bool hasLabel = !(*it).label().isEmpty(); | 102 | bool hasLabel = !(*it).label().isEmpty(); |
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 | ||
112 | card.addLine( adrLine ); | 123 | card.addLine( adrLine ); |
113 | if ( hasLabel ) | 124 | if ( hasLabel ) |
114 | card.addLine( labelLine ); | 125 | card.addLine( labelLine ); |
@@ -230,13 +241,16 @@ QString VCardTool::createVCards( Addressee::List list, VCard::Version version ) | |||
230 | for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) { | 241 | for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) { |
231 | VCardLine line( "TEL", (*phoneIt).number() ); | 242 | VCardLine line( "TEL", (*phoneIt).number() ); |
232 | 243 | ||
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 ); |
240 | } | 254 | } |
241 | 255 | ||
242 | // TITLE | 256 | // TITLE |