diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-14 20:16:30 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-14 20:16:30 +0000 |
commit | 1c93fca14d9ce37499bcfdf994c660186a0b6f17 (patch) | |
tree | f2defe163a805a9e34a2142dfde4cdb5e49241e7 /libkmime | |
parent | 67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (diff) | |
download | tdepim-1c93fca14d9ce37499bcfdf994c660186a0b6f17.tar.gz tdepim-1c93fca14d9ce37499bcfdf994c660186a0b6f17.zip |
Enable kdepim compilation under Qt4
This will likely break Qt3 compilation temporarily, which is an unintended side effect.
A third and final kdepim commit will repair Qt3 compilation shortly.
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227946 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkmime')
-rw-r--r-- | libkmime/kmime_codecs.cpp | 2 | ||||
-rw-r--r-- | libkmime/kmime_content.cpp | 6 | ||||
-rw-r--r-- | libkmime/kmime_header_parsing.cpp | 8 | ||||
-rw-r--r-- | libkmime/kmime_headers.cpp | 16 | ||||
-rw-r--r-- | libkmime/kmime_parsers.cpp | 16 | ||||
-rw-r--r-- | libkmime/kmime_util.cpp | 12 | ||||
-rw-r--r-- | libkmime/kqcstringsplitter.cpp | 8 |
7 files changed, 35 insertions, 33 deletions
diff --git a/libkmime/kmime_codecs.cpp b/libkmime/kmime_codecs.cpp index 1476477b6..bf33159e0 100644 --- a/libkmime/kmime_codecs.cpp +++ b/libkmime/kmime_codecs.cpp @@ -230,7 +230,7 @@ bool Encoder::flushOutputBuffer( char* & dcursor, const char * const dend ) { int numCharsLeft = mOutputBufferCursor - i; // push the remaining chars to the begin of the buffer: if ( numCharsLeft ) - qmemmove( mOutputBuffer, mOutputBuffer + i, numCharsLeft ); + tqmemmove( mOutputBuffer, mOutputBuffer + i, numCharsLeft ); // adjust cursor: mOutputBufferCursor = numCharsLeft; diff --git a/libkmime/kmime_content.cpp b/libkmime/kmime_content.cpp index 7ac10bbba..fc3af97b0 100644 --- a/libkmime/kmime_content.cpp +++ b/libkmime/kmime_content.cpp @@ -537,7 +537,7 @@ void Content::addContent(Content *c, bool prepend) for(Headers::Base *h=srcHdrs.first(); h; h=srcHdrs.next()) { if(h->isMimeHeader()) { //remove from this content - idx=h_eaders->findRef(h); + idx=h_eaders->tqfindRef(h); h_eaders->take(idx); //append to new content main->h_eaders->append(h); @@ -582,7 +582,7 @@ void Content::removeContent(Content *c, bool del) if(del) c_ontents->removeRef(c); else { - idx=c_ontents->findRef(c); + idx=c_ontents->tqfindRef(c); c_ontents->take(idx); } @@ -604,7 +604,7 @@ void Content::removeContent(Content *c, bool del) if(h->isMimeHeader()) { removeHeader(h->type()); //remove the old header first h_eaders->append(h); //now append the new one - idx=main->h_eaders->findRef(h); + idx=main->h_eaders->tqfindRef(h); main->h_eaders->take(idx); //remove from the old content kdDebug(5003) << "Content::removeContent(Content *c, bool del) : mime-header moved: " << h->as7BitString() << endl; diff --git a/libkmime/kmime_header_parsing.cpp b/libkmime/kmime_header_parsing.cpp index cf825a16a..59957f10b 100644 --- a/libkmime/kmime_header_parsing.cpp +++ b/libkmime/kmime_header_parsing.cpp @@ -1104,7 +1104,7 @@ bool parseParameter( const char* & scursor, const char * const send, "Chopping away \"*\"." << endl; maybeAttribute.truncate( maybeAttribute.length() - 1 ); } - result = qMakePair( maybeAttribute.lower(), TQStringOrTQPair() ); + result = tqMakePair( maybeAttribute.lower(), TQStringOrTQPair() ); return true; } @@ -1128,19 +1128,19 @@ bool parseParameter( const char* & scursor, const char * const send, if ( !parseGenericQuotedString( scursor, send, maybeValue.qstring, isCRLF ) ) { scursor = oldscursor; - result = qMakePair( maybeAttribute.lower(), TQStringOrTQPair() ); + result = tqMakePair( maybeAttribute.lower(), TQStringOrTQPair() ); return false; // this case needs further processing by upper layers!! } } else { // value is a token: if ( !parseToken( scursor, send, maybeValue.qpair, false /* no 8bit */ ) ) { scursor = oldscursor; - result = qMakePair( maybeAttribute.lower(), TQStringOrTQPair() ); + result = tqMakePair( maybeAttribute.lower(), TQStringOrTQPair() ); return false; // this case needs further processing by upper layers!! } } - result = qMakePair( maybeAttribute.lower(), maybeValue ); + result = tqMakePair( maybeAttribute.lower(), maybeValue ); return true; } diff --git a/libkmime/kmime_headers.cpp b/libkmime/kmime_headers.cpp index a677cdd75..40a016343 100644 --- a/libkmime/kmime_headers.cpp +++ b/libkmime/kmime_headers.cpp @@ -811,7 +811,7 @@ TQDateTime Date::qdt() int Date::ageInDays() { - TQDate today=TQDate::tqcurrentDate(); + TQDate today=TQDate::currentDate(); return ( qdt().date().daysTo(today) ); } @@ -1107,10 +1107,10 @@ TQCString References::next() TQCString ret; if(p_os!=0) { - pos2=r_ef.findRev('>', p_os); + pos2=r_ef.tqfindRev('>', p_os); p_os=0; if(pos2!=-1) { - pos1=r_ef.findRev('<', pos2); + pos1=r_ef.tqfindRev('<', pos2); if(pos1!=-1) { ret=r_ef.mid(pos1, pos2-pos1+1); p_os=pos1; @@ -1129,7 +1129,7 @@ TQCString References::at(unsigned int i) while(pos1!=-1 && cnt < i+1) { pos2=pos1-1; - pos1=r_ef.findRev('<', pos2); + pos1=r_ef.tqfindRev('<', pos2); cnt++; } @@ -1174,7 +1174,7 @@ void References::append(const TQCString &s) for (int i=1;i<=3;i++) { // include the last three ids if (!lst.isEmpty()) { temp = lst.last(); - r_ef.insert(insPos,(TQString(" %1").arg(temp)).latin1()); + r_ef.insert(insPos,(TQString(" %1").tqarg(temp)).latin1()); lst.remove(temp); } else break; @@ -1183,7 +1183,7 @@ void References::append(const TQCString &s) while (!lst.isEmpty()) { // now insert the rest, up to 1000 characters temp = lst.last(); if ((15+r_ef.length()+temp.length())<1000) { - r_ef.insert(insPos,(TQString(" %1").arg(temp)).latin1()); + r_ef.insert(insPos,(TQString(" %1").tqarg(temp)).latin1()); lst.remove(temp); } else return; @@ -1475,7 +1475,7 @@ void ContentType::setParameter(const TQCString &name, const TQCString &value, bo else param=name+"="+value; - pos1=p_arams.tqfind(name, 0, false); + pos1=p_arams.tqfind(name.data(), 0, false); if(pos1==-1) { p_arams+="; "+param; } @@ -1484,7 +1484,7 @@ void ContentType::setParameter(const TQCString &name, const TQCString &value, bo if(pos2==-1) pos2=p_arams.length(); p_arams.remove(pos1, pos2-pos1); - p_arams.insert(pos1, param); + p_arams.insert(pos1, param.data()); } } diff --git a/libkmime/kmime_parsers.cpp b/libkmime/kmime_parsers.cpp index c9dc1e3d1..a7f758bf0 100644 --- a/libkmime/kmime_parsers.cpp +++ b/libkmime/kmime_parsers.cpp @@ -39,7 +39,7 @@ bool MultiPart::parse() //find the first valid boundary while(1) { - if( (pos1=s_rc.tqfind(b, pos1))==-1 || pos1==0 || s_rc[pos1-1]=='\n' ) //valid boundary found or no boundary at all + if( (pos1=s_rc.tqfind(b.data(), pos1))==-1 || pos1==0 || s_rc[pos1-1]=='\n' ) //valid boundary found or no boundary at all break; pos1+=blen; //boundary found but not valid => skip it; } @@ -60,7 +60,7 @@ bool MultiPart::parse() //now find the next valid boundary pos2=++pos1; //pos1 and pos2 point now to the beginning of the next line after the boundary while(1) { - if( (pos2=s_rc.tqfind(b, pos2))==-1 || s_rc[pos2-1]=='\n' ) //valid boundary or no more boundaries found + if( (pos2=s_rc.tqfind(b.data(), pos2))==-1 || s_rc[pos2-1]=='\n' ) //valid boundary or no more boundaries found break; pos2+=blen; //boundary is invalid => skip it; } @@ -108,7 +108,7 @@ TQCString NonMimeParser::guessMimeType(const TQCString& fileName) int pos; if(!fileName.isEmpty()) { - pos=fileName.findRev('.'); + pos=fileName.tqfindRev('.'); if(pos++ != -1) { tmp=fileName.mid(pos, fileName.length()-pos).upper(); if(tmp=="JPG" || tmp=="JPEG") mimeType="image/jpeg"; @@ -188,7 +188,7 @@ bool UUEncoded::parse() break; //too many "non-M-Lines" found, we give up } - if( (!containsBegin || !containsEnd) && s_ubject) { // message may be split up => parse subject + if( (!containsBegin || !containsEnd) && !s_ubject.isNull()) { // message may be split up => parse subject TQRegExp rx("[0-9]+/[0-9]+"); pos=rx.search(TQString(s_ubject), 0); len=rx.matchedLength(); @@ -249,7 +249,7 @@ bool YENCEncoded::yencMeta(TQCString& src, const TQCString& name, int* value) bool found = false; TQCString sought=name + "="; - int iPos=src.tqfind( sought); + int iPos=src.tqfind( sought.data() ); if (iPos>-1) { int pos1=src.tqfind(' ', iPos); int pos2=src.tqfind('\r', iPos); @@ -261,7 +261,7 @@ bool YENCEncoded::yencMeta(TQCString& src, const TQCString& name, int* value) pos1=pos3; if (pos4>=0 && (pos1<0 || pos1>pos4)) pos1=pos4; - iPos=src.findRev( '=', pos1)+1; + iPos=src.tqfindRev( '=', pos1)+1; if (iPos<pos1) { char c=src.at( iPos); if ( c>='0' && c<='9') { @@ -391,7 +391,7 @@ bool YENCEncoded::parse() ch+=256; if (totalSize>=yencSize) break; - binary.at(totalSize++)=ch; + binary.tqat(totalSize++)=ch; lineLength++; } else @@ -404,7 +404,7 @@ bool YENCEncoded::parse() ch+=256; if (totalSize>=yencSize) break; - binary.at(totalSize++)=ch; + binary.tqat(totalSize++)=ch; lineLength++; pos++; } diff --git a/libkmime/kmime_util.cpp b/libkmime/kmime_util.cpp index 167ac78d7..6fea9fc84 100644 --- a/libkmime/kmime_util.cpp +++ b/libkmime/kmime_util.cpp @@ -32,6 +32,7 @@ #include <tqtextcodec.h> #include <tqstrlist.h> // for TQStrIList #include <tqregexp.h> +#include <tqdatetime.h> #include <stdlib.h> #include <ctype.h> @@ -71,7 +72,7 @@ bool isUsAscii(const TQString &s) { uint sLength = s.length(); for (uint i=0; i<sLength; i++) - if (s.at(i).latin1()<=0) // c==0: non-latin1, c<0: non-us-ascii + if (s.tqat(i).latin1()<=0) // c==0: non-latin1, c<0: non-us-ascii return false; return true; @@ -126,7 +127,8 @@ TQString decodeRFC2047String(const TQCString &src, const char **usedCS, { TQCString result, str; TQCString declaredCS; - char *pos, *dest, *beg, *end, *mid, *endOfLastEncWord=0; + const char *beg, *end, *mid, *pos=0; + char *dest, *endOfLastEncWord=0; char encoding = '\0'; bool valid, onlySpacesSinceLastWord=false; const int maxLen=400; @@ -375,7 +377,7 @@ TQCString extractHeader(const TQCString &src, const char *name) pos1 = 0; } else { n.prepend("\n"); - pos1 = src.tqfind(n,0,false); + pos1 = src.tqfind(n.data(),0,false); } if (pos1>-1) { //there is a header with the given name @@ -681,14 +683,14 @@ DateFormatter::fancy(time_t otime) const if ( diff < 24 * 60 * 60 ) { if ( old.date().year() == mDate.date().year() && old.date().dayOfYear() == mDate.date().dayOfYear() ) - return i18n( "Today %1" ).arg( locale-> + return i18n( "Today %1" ).tqarg( locale-> formatTime( old.time(), true ) ); } if ( diff < 2 * 24 * 60 * 60 ) { TQDateTime yesterday( mDate.addDays( -1 ) ); if ( old.date().year() == yesterday.date().year() && old.date().dayOfYear() == yesterday.date().dayOfYear() ) - return i18n( "Yesterday %1" ).arg( locale-> + return i18n( "Yesterday %1" ).tqarg( locale-> formatTime( old.time(), true) ); } for ( int i = 3; i < 7; i++ ) diff --git a/libkmime/kqcstringsplitter.cpp b/libkmime/kqcstringsplitter.cpp index 4f8263133..d406691c3 100644 --- a/libkmime/kqcstringsplitter.cpp +++ b/libkmime/kqcstringsplitter.cpp @@ -52,7 +52,7 @@ bool KTQCStringSplitter::first() start=0; - end=src.tqfind(sep, start); + end=src.tqfind(sep.data(), start); if(end!=-1) { dst=src.mid(start, end); @@ -83,7 +83,7 @@ bool KTQCStringSplitter::last() end=src.length(); - start=src.findRev(sep,end); + start=src.tqfindRev(sep.data(),end); if(start!=-1) { dst=src.mid(start, end-start); @@ -106,7 +106,7 @@ bool KTQCStringSplitter::next() if(start< (int) src.length()) { - end=src.tqfind(sep, start); + end=src.tqfind(sep.data(), start); if(end!=-1) { dst=src.mid(start, end-start); @@ -142,7 +142,7 @@ bool KTQCStringSplitter::prev() if(end>0) { - start=src.findRev(sep,end); + start=src.tqfindRev(sep.data(),end); if(start!=-1) dst=src.mid(start, end-start); |