author | zautrix <zautrix> | 2004-10-13 05:15:03 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-13 05:15:03 (UTC) |
commit | f08cf9044213a60c87e2bf299665d13a335feff5 (patch) (unidiff) | |
tree | c9c0e8b0f7f7a48dcee8fbdd5b9a467985c78fdd | |
parent | 308bc78a3ab0d27718070a5ebdf3f019ac570c6b (diff) | |
download | kdepimpi-f08cf9044213a60c87e2bf299665d13a335feff5.zip kdepimpi-f08cf9044213a60c87e2bf299665d13a335feff5.tar.gz kdepimpi-f08cf9044213a60c87e2bf299665d13a335feff5.tar.bz2 |
fixed some newline probs
-rw-r--r-- | kabc/vcard/ContentLine.cpp | 1 | ||||
-rw-r--r-- | kabc/vcardformatimpl.cpp | 8 | ||||
-rw-r--r-- | kabc/vcardparser/vcardparser.cpp | 2 | ||||
-rw-r--r-- | kabc/vcardparser/vcardtool.cpp | 10 |
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() | |||
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 | } |
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 ) | |||
839 | isIntern = false; | 839 | isIntern = false; |
840 | } | 840 | } |
841 | 841 | ||
842 | if ( isIntern ) { | 842 | if ( isIntern ) { |
843 | QString vstr = QString::fromUtf8( v->asString() ); | 843 | QString vstr = QString::fromUtf8( v->asString() ); |
844 | qDebug("VCardFormatImpl::addAgentValue please verify if replace is correct"); | 844 | qDebug("VCardFormatImpl::addAgentValue please verify if replace is correct"); |
845 | /*US | 845 | /*US |
846 | vstr.replace( "\\n", "\r\n" ); | 846 | vstr.replace( "\\n", "\r\n" ); |
847 | vstr.replace( "\\:", ":" ); | 847 | vstr.replace( "\\:", ":" ); |
848 | vstr.replace( "\\,", "," ); | 848 | vstr.replace( "\\,", "," ); |
849 | vstr.replace( "\\;", ";" ); | 849 | vstr.replace( "\\;", ";" ); |
850 | */ | 850 | */ |
851 | vstr.replace( QRegExp("\\n"), "\r\n" ); | 851 | vstr.replace( QRegExp("\\\\n"), "\r\n" ); |
852 | vstr.replace( QRegExp("\\:"), ":" ); | 852 | vstr.replace( QRegExp("\\\\:"), ":" ); |
853 | vstr.replace( QRegExp("\\,"), "," ); | 853 | vstr.replace( QRegExp("\\\\,"), "," ); |
854 | vstr.replace( QRegExp("\\;"), ";" ); | 854 | vstr.replace( QRegExp("\\\\;"), ";" ); |
855 | 855 | ||
856 | Addressee *addr = new Addressee; | 856 | Addressee *addr = new Addressee; |
857 | readFromString( vstr, *addr ); | 857 | readFromString( vstr, *addr ); |
858 | agent.setAddressee( addr ); | 858 | agent.setAddressee( addr ); |
859 | } else { | 859 | } else { |
860 | agent.setUrl( QString::fromUtf8( v->asString() ) ); | 860 | agent.setUrl( QString::fromUtf8( v->asString() ) ); |
861 | } | 861 | } |
862 | 862 | ||
863 | return agent; | 863 | return agent; |
864 | } | 864 | } |
865 | 865 | ||
866 | void VCardFormatImpl::addPictureValue( VCARD::VCard *vcard, VCARD::EntityType type, const Picture &pic, const Addressee &addr, bool intern ) | 866 | 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 ) | |||
104 | qDebug("****************************************** "); | 104 | qDebug("****************************************** "); |
105 | qDebug("************* WARNING ******************** "); | 105 | qDebug("************* WARNING ******************** "); |
106 | qDebug("****************************************** "); | 106 | qDebug("****************************************** "); |
107 | qDebug("Make sure, the decoding is done after"); | 107 | qDebug("Make sure, the decoding is done after"); |
108 | qDebug("QVariant conversion!"); | 108 | qDebug("QVariant conversion!"); |
109 | qDebug("Insert Line DECODING OKAY, where this is implemented"); | 109 | qDebug("Insert Line DECODING OKAY, where this is implemented"); |
110 | // use for decoding the above code! | 110 | // use for decoding the above code! |
111 | vCardLine.setValue( cs ); | 111 | vCardLine.setValue( cs ); |
112 | } else { | 112 | } else { |
113 | 113 | ||
114 | //qDebug("VCardParser::parseVCards has to be verified"); | 114 | //qDebug("VCardParser::parseVCards has to be verified"); |
115 | //US vCardLine.setValue( value.replace( "\\n", "\n" ) ); | 115 | //US vCardLine.setValue( value.replace( "\\n", "\n" ) ); |
116 | vCardLine.setValue( value.replace( QRegExp("\\n"), "\n" ) ); | 116 | vCardLine.setValue( value.replace( QRegExp("\\\\n"), "\n" ) ); |
117 | } | 117 | } |
118 | 118 | ||
119 | currentVCard.addLine( vCardLine ); | 119 | currentVCard.addLine( vCardLine ); |
120 | } | 120 | } |
121 | // we do not save the start and end tag as vcardline | 121 | // we do not save the start and end tag as vcardline |
122 | if ( (*it).lower().startsWith( "begin:vcard" ) ) { | 122 | if ( (*it).lower().startsWith( "begin:vcard" ) ) { |
123 | inVCard = true; | 123 | inVCard = true; |
124 | //qDebug("VCardParser::parseVCards has to be verified"); | 124 | //qDebug("VCardParser::parseVCards has to be verified"); |
125 | //US currentLine.setLength( 0 ); | 125 | //US currentLine.setLength( 0 ); |
126 | currentLine = ""; | 126 | currentLine = ""; |
127 | currentVCard.clear(); // flush vcard | 127 | currentVCard.clear(); // flush vcard |
128 | continue; | 128 | 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 ) | |||
803 | } else { | 803 | } else { |
804 | QString str = line.value().asString(); | 804 | QString str = line.value().asString(); |
805 | 805 | ||
806 | //US using the old implementation instead | 806 | //US using the old implementation instead |
807 | qDebug("VCardTool::parseAgent has to be verified"); | 807 | qDebug("VCardTool::parseAgent has to be verified"); |
808 | /*US | 808 | /*US |
809 | str.replace( "\\n", "\r\n" ); | 809 | str.replace( "\\n", "\r\n" ); |
810 | str.replace( "\\N", "\r\n" ); | 810 | str.replace( "\\N", "\r\n" ); |
811 | str.replace( "\\;", ";" ); | 811 | str.replace( "\\;", ";" ); |
812 | str.replace( "\\:", ":" ); | 812 | str.replace( "\\:", ":" ); |
813 | str.replace( "\\,", "," ); | 813 | str.replace( "\\,", "," ); |
814 | */ | 814 | */ |
815 | str.replace( QRegExp("\\n") , "\r\n" ); | 815 | str.replace( QRegExp("\\\\n") , "\r\n" ); |
816 | str.replace( QRegExp("\\N") , "\r\n" ); | 816 | str.replace( QRegExp("\\\\N") , "\r\n" ); |
817 | str.replace( QRegExp("\\;") , ";" ); | 817 | str.replace( QRegExp("\\\\;") , ";" ); |
818 | str.replace( QRegExp("\\:") , ":" ); | 818 | str.replace( QRegExp("\\\\:") , ":" ); |
819 | str.replace( QRegExp("\\,") , "," ); | 819 | str.replace( QRegExp("\\\\,") , "," ); |
820 | 820 | ||
821 | Addressee::List list = parseVCards( str ); | 821 | Addressee::List list = parseVCards( str ); |
822 | if ( list.count() > 0 ) { | 822 | if ( list.count() > 0 ) { |
823 | Addressee *addr = new Addressee; | 823 | Addressee *addr = new Addressee; |
824 | *addr = list[ 0 ]; | 824 | *addr = list[ 0 ]; |
825 | agent.setAddressee( addr ); | 825 | agent.setAddressee( addr ); |
826 | } | 826 | } |
827 | } | 827 | } |
828 | 828 | ||
829 | return agent; | 829 | return agent; |
830 | } | 830 | } |
831 | 831 | ||