summaryrefslogtreecommitdiffabout
path: root/kabc/vcardparser/vcardparser.cpp
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kabc/vcardparser/vcardparser.cpp
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'kabc/vcardparser/vcardparser.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kabc/vcardparser/vcardparser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/kabc/vcardparser/vcardparser.cpp b/kabc/vcardparser/vcardparser.cpp
index 11622a0..a319531 100644
--- a/kabc/vcardparser/vcardparser.cpp
+++ b/kabc/vcardparser/vcardparser.cpp
@@ -197,44 +197,44 @@ QString VCardParser::createVCards( const VCard::List& list )
params = (*lineIt).parameterList();
hasEncoding = false;
if ( params.count() > 0 ) { // we have parameters
for ( paramIt = params.begin(); paramIt != params.end(); ++paramIt ) {
if ( (*paramIt) == "encoding" ) {
hasEncoding = true;
encodingType = (*lineIt).parameter( "encoding" ).lower();
}
values = (*lineIt).parameters( *paramIt );
for ( valueIt = values.begin(); valueIt != values.end(); ++valueIt ) {
textLine.append( ";" + (*paramIt).upper() );
if ( !(*valueIt).isEmpty() )
textLine.append( "=" + (*valueIt) );
}
}
}
if ( hasEncoding ) { // have to encode the data
QByteArray input, output;
input = (*lineIt).valueBytes();
if ( encodingType == "b" )
KCodecs::base64Encode( input, output );
else if ( encodingType == "quoted-printable" )
- KCodecs::quotedPrintableEncode( input, output );
+ KCodecs::quotedPrintableEncode( input, output, true );
textLine.append( ":" + QString( output ) );
} else
textLine.append( ":" + (*lineIt).valueString().replace( QRegExp("\n"), "\\n" ) );
if ( textLine.length() > FOLD_WIDTH ) { // we have to fold the line
for ( uint i = 0; i <= ( textLine.length() / FOLD_WIDTH ); ++i )
text.append( ( i == 0 ? "" : " " ) + textLine.mid( i * FOLD_WIDTH, FOLD_WIDTH ) + "\r\n" );
} else
text.append( textLine + "\r\n" );
}
}
}
text.append( "END:VCARD\r\n" );
text.append( "\r\n" );
}
return text;
}