summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/vcard/ContentLine.cpp1
-rw-r--r--kabc/vcardformatimpl.cpp8
-rw-r--r--kabc/vcardparser/vcardparser.cpp2
-rw-r--r--kabc/vcardparser/vcardtool.cpp10
4 files changed, 11 insertions, 10 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
@@ -298,23 +298,24 @@ ContentLine::_assemble()
// Quote newlines
line = line.replace( QRegExp( "\n" ), "\\n" );
// Fold lines longer than 72 chars
const int maxLen = 72;
uint cursor = 0;
while( line.length() > ( cursor + 1 ) * maxLen ) {
strRep_ += line.mid( cursor * maxLen, maxLen );
strRep_ += "\r\n ";
++cursor;
}
strRep_ += line.mid( cursor * maxLen );
+ //qDebug("ContentLine::_assemble()\n%s*****", strRep_.data());
}
void
ContentLine::clear()
{
group_.truncate(0);
name_.truncate(0);
paramList_.clear();
delete value_;
value_ = 0;
}
diff --git a/kabc/vcardformatimpl.cpp b/kabc/vcardformatimpl.cpp
index ede5773..c31af46 100644
--- a/kabc/vcardformatimpl.cpp
+++ b/kabc/vcardformatimpl.cpp
@@ -839,28 +839,28 @@ Agent VCardFormatImpl::readAgentValue( VCARD::ContentLine *cl )
isIntern = false;
}
if ( isIntern ) {
QString vstr = QString::fromUtf8( v->asString() );
qDebug("VCardFormatImpl::addAgentValue please verify if replace is correct");
/*US
vstr.replace( "\\n", "\r\n" );
vstr.replace( "\\:", ":" );
vstr.replace( "\\,", "," );
vstr.replace( "\\;", ";" );
*/
- vstr.replace( QRegExp("\\n"), "\r\n" );
- vstr.replace( QRegExp("\\:"), ":" );
- vstr.replace( QRegExp("\\,"), "," );
- vstr.replace( QRegExp("\\;"), ";" );
+ vstr.replace( QRegExp("\\\\n"), "\r\n" );
+ vstr.replace( QRegExp("\\\\:"), ":" );
+ vstr.replace( QRegExp("\\\\,"), "," );
+ vstr.replace( QRegExp("\\\\;"), ";" );
Addressee *addr = new Addressee;
readFromString( vstr, *addr );
agent.setAddressee( addr );
} else {
agent.setUrl( QString::fromUtf8( v->asString() ) );
}
return agent;
}
void VCardFormatImpl::addPictureValue( VCARD::VCard *vcard, VCARD::EntityType type, const Picture &pic, const Addressee &addr, bool intern )
diff --git a/kabc/vcardparser/vcardparser.cpp b/kabc/vcardparser/vcardparser.cpp
index 9ea084d..bec2a0c 100644
--- a/kabc/vcardparser/vcardparser.cpp
+++ b/kabc/vcardparser/vcardparser.cpp
@@ -104,25 +104,25 @@ VCard::List VCardParser::parseVCards( const QString& text )
qDebug("****************************************** ");
qDebug("************* WARNING ******************** ");
qDebug("****************************************** ");
qDebug("Make sure, the decoding is done after");
qDebug("QVariant conversion!");
qDebug("Insert Line DECODING OKAY, where this is implemented");
// use for decoding the above code!
vCardLine.setValue( cs );
} else {
//qDebug("VCardParser::parseVCards has to be verified");
//US vCardLine.setValue( value.replace( "\\n", "\n" ) );
- vCardLine.setValue( value.replace( QRegExp("\\n"), "\n" ) );
+ vCardLine.setValue( value.replace( QRegExp("\\\\n"), "\n" ) );
}
currentVCard.addLine( vCardLine );
}
// we do not save the start and end tag as vcardline
if ( (*it).lower().startsWith( "begin:vcard" ) ) {
inVCard = true;
//qDebug("VCardParser::parseVCards has to be verified");
//US currentLine.setLength( 0 );
currentLine = "";
currentVCard.clear(); // flush vcard
continue;
diff --git a/kabc/vcardparser/vcardtool.cpp b/kabc/vcardparser/vcardtool.cpp
index 3fb212e..d1f823b 100644
--- a/kabc/vcardparser/vcardtool.cpp
+++ b/kabc/vcardparser/vcardtool.cpp
@@ -803,29 +803,29 @@ Agent VCardTool::parseAgent( const VCardLine &line )
} else {
QString str = line.value().asString();
//US using the old implementation instead
qDebug("VCardTool::parseAgent has to be verified");
/*US
str.replace( "\\n", "\r\n" );
str.replace( "\\N", "\r\n" );
str.replace( "\\;", ";" );
str.replace( "\\:", ":" );
str.replace( "\\,", "," );
*/
- str.replace( QRegExp("\\n") , "\r\n" );
- str.replace( QRegExp("\\N") , "\r\n" );
- str.replace( QRegExp("\\;") , ";" );
- str.replace( QRegExp("\\:") , ":" );
- str.replace( QRegExp("\\,") , "," );
+ str.replace( QRegExp("\\\\n") , "\r\n" );
+ str.replace( QRegExp("\\\\N") , "\r\n" );
+ str.replace( QRegExp("\\\\;") , ";" );
+ str.replace( QRegExp("\\\\:") , ":" );
+ str.replace( QRegExp("\\\\,") , "," );
Addressee::List list = parseVCards( str );
if ( list.count() > 0 ) {
Addressee *addr = new Addressee;
*addr = list[ 0 ];
agent.setAddressee( addr );
}
}
return agent;
}