-rw-r--r-- | kabc/vcard/ContentLine.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kabc/vcard/ContentLine.cpp b/kabc/vcard/ContentLine.cpp index 2f88cde..0a2f97d 100644 --- a/kabc/vcard/ContentLine.cpp +++ b/kabc/vcard/ContentLine.cpp @@ -158,14 +158,19 @@ ContentLine::~ContentLine() void ContentLine::_parse() { vDebug("parse"); - // Unqote newlines + // Unfold folded lines + // NLR + strRep_ = strRep_.replace( QRegExp( "\\r" ), "" ); + // Unqote newlines strRep_ = strRep_.replace( QRegExp( "\\\\n" ), "\n" ); + //NLR + strRep_ = strRep_.replace( QRegExp( "\\\\r" ), "\r" ); int split = strRep_.find(':'); if (split == -1) { // invalid content line vDebug("No ':'"); return; @@ -282,12 +287,13 @@ ContentLine::_assemble() for (; it.current(); ++it) line += ";" + it.current()->asString(); if (value_ != 0) line += ":" + value_->asString(); + line = line.replace( QRegExp( "\r" ), "\\r" ); line = line.replace( QRegExp( "\n" ), "\\n" ); // Fold lines longer than 72 chars const int maxLen = 72; uint cursor = 0; QString cut; |