-rw-r--r-- | kabc/vcard/ContentLine.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kabc/vcard/ContentLine.cpp b/kabc/vcard/ContentLine.cpp index f7e04a9..c368172 100644 --- a/kabc/vcard/ContentLine.cpp +++ b/kabc/vcard/ContentLine.cpp | |||
@@ -262,59 +262,60 @@ ContentLine::_parse() | |||
262 | case ValueDate: value_ = new DateValue; break; | 262 | case ValueDate: value_ = new DateValue; break; |
263 | case ValueTextList: value_ = new TextListValue;break; | 263 | case ValueTextList: value_ = new TextListValue;break; |
264 | case ValueGeo: value_ = new GeoValue; break; | 264 | case ValueGeo: value_ = new GeoValue; break; |
265 | case ValueText: | 265 | case ValueText: |
266 | case ValueUnknown: | 266 | case ValueUnknown: |
267 | default: value_ = new TextValue; break; | 267 | default: value_ = new TextValue; break; |
268 | } | 268 | } |
269 | 269 | ||
270 | *value_ = valuePart; | 270 | *value_ = valuePart; |
271 | } | 271 | } |
272 | 272 | ||
273 | void | 273 | void |
274 | ContentLine::_assemble() | 274 | ContentLine::_assemble() |
275 | { | 275 | { |
276 | vDebug("Assemble (argl) - my name is \"" + name_ + "\""); | 276 | vDebug("Assemble (argl) - my name is \"" + name_ + "\""); |
277 | strRep_.truncate(0); | 277 | strRep_.truncate(0); |
278 | 278 | ||
279 | QCString line; | 279 | QCString line; |
280 | 280 | ||
281 | if (!group_.isEmpty()) | 281 | if (!group_.isEmpty()) |
282 | line += group_ + '.'; | 282 | line += group_ + '.'; |
283 | 283 | ||
284 | line += name_; | 284 | line += name_; |
285 | 285 | ||
286 | vDebug("Adding parameters"); | 286 | vDebug("Adding parameters"); |
287 | ParamListIterator it(paramList_); | 287 | ParamListIterator it(paramList_); |
288 | 288 | ||
289 | for (; it.current(); ++it) | 289 | for (; it.current(); ++it) |
290 | line += ";" + it.current()->asString(); | 290 | line += ";" + it.current()->asString(); |
291 | 291 | ||
292 | vDebug("Adding value"); | 292 | vDebug("Adding value"); |
293 | if (value_ != 0) | 293 | if (value_ != 0) |
294 | line += ":" + value_->asString(); | 294 | line += ":" + value_->asString(); |
295 | else | 295 | else |
296 | vDebug("No value"); | 296 | vDebug("No value"); |
297 | 297 | ||
298 | // Quote newlines | 298 | // Quote newlines |
299 | line = line.replace( QRegExp( "\n" ), "\\n" ); | 299 | line = line.replace( QRegExp( "\n" ), "\\n" ); |
300 | 300 | ||
301 | // Fold lines longer than 72 chars | 301 | // Fold lines longer than 72 chars |
302 | const int maxLen = 72; | 302 | const int maxLen = 72; |
303 | uint cursor = 0; | 303 | uint cursor = 0; |
304 | while( line.length() > ( cursor + 1 ) * maxLen ) { | 304 | while( line.length() > ( cursor + 1 ) * maxLen ) { |
305 | strRep_ += line.mid( cursor * maxLen, maxLen ); | 305 | strRep_ += line.mid( cursor * maxLen, maxLen ); |
306 | strRep_ += "\r\n "; | 306 | strRep_ += "\r\n "; |
307 | ++cursor; | 307 | ++cursor; |
308 | } | 308 | } |
309 | strRep_ += line.mid( cursor * maxLen ); | 309 | strRep_ += line.mid( cursor * maxLen ); |
310 | //qDebug("ContentLine::_assemble()\n%s*****", strRep_.data()); | ||
310 | } | 311 | } |
311 | 312 | ||
312 | void | 313 | void |
313 | ContentLine::clear() | 314 | ContentLine::clear() |
314 | { | 315 | { |
315 | group_.truncate(0); | 316 | group_.truncate(0); |
316 | name_.truncate(0); | 317 | name_.truncate(0); |
317 | paramList_.clear(); | 318 | paramList_.clear(); |
318 | delete value_; | 319 | delete value_; |
319 | value_ = 0; | 320 | value_ = 0; |
320 | } | 321 | } |