summaryrefslogtreecommitdiffstats
path: root/libkmime
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
commit4c6f8d69e2d1501837affb472c4eb8fec4462240 (patch)
tree766a8ad7939fcf3eec534184c36bd0e0f80489e2 /libkmime
parent469cc56a805bd3d6940d54adbef554877c29853c (diff)
downloadtdepim-4c6f8d69e2d1501837affb472c4eb8fec4462240.tar.gz
tdepim-4c6f8d69e2d1501837affb472c4eb8fec4462240.zip
rename the following methods:
tqfind find tqreplace replace tqcontains contains git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkmime')
-rw-r--r--libkmime/kmime_content.cpp26
-rw-r--r--libkmime/kmime_content.h2
-rw-r--r--libkmime/kmime_headers.cpp58
-rw-r--r--libkmime/kmime_headers.h6
-rw-r--r--libkmime/kmime_mdn.cpp4
-rw-r--r--libkmime/kmime_message.cpp2
-rw-r--r--libkmime/kmime_newsarticle.cpp2
-rw-r--r--libkmime/kmime_parsers.cpp48
-rw-r--r--libkmime/kmime_util.cpp24
-rw-r--r--libkmime/kqcstringsplitter.cpp8
-rwxr-xr-xlibkmime/tests/run_codec_tests2
11 files changed, 91 insertions, 91 deletions
diff --git a/libkmime/kmime_content.cpp b/libkmime/kmime_content.cpp
index fc3af97b0..eb8deb8a2 100644
--- a/libkmime/kmime_content.cpp
+++ b/libkmime/kmime_content.cpp
@@ -85,7 +85,7 @@ void Content::setContent(TQStrList *l)
void Content::setContent(const TQCString &s)
{
- int pos=s.tqfind("\n\n", 0);
+ int pos=s.find("\n\n", 0);
if(pos>-1) {
h_ead=s.left(++pos); //header *must* end with "\n" !!
b_ody=s.mid(pos+1, s.length()-pos-1);
@@ -313,9 +313,9 @@ TQCString Content::encodedContent(bool useCrLf)
// add proper mime headers...
if (convertNonMimeBinaries) {
- h_ead.tqreplace(TQRegExp("MIME-Version: .*\\n"),"");
- h_ead.tqreplace(TQRegExp("Content-Type: .*\\n"),"");
- h_ead.tqreplace(TQRegExp("Content-Transfer-Encoding: .*\\n"),"");
+ h_ead.replace(TQRegExp("MIME-Version: .*\\n"),"");
+ h_ead.replace(TQRegExp("Content-Type: .*\\n"),"");
+ h_ead.replace(TQRegExp("Content-Transfer-Encoding: .*\\n"),"");
h_ead+="MIME-Version: 1.0\n";
h_ead+=contentType(true)->as7BitString()+"\n";
h_ead+=contentTransferEncoding(true)->as7BitString()+"\n";
@@ -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->tqfindRef(h);
+ idx=h_eaders->findRef(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->tqfindRef(c);
+ idx=c_ontents->findRef(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->tqfindRef(h);
+ idx=main->h_eaders->findRef(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;
@@ -652,7 +652,7 @@ void Content::toStream(TQTextStream &ts, bool scrambleFromLines)
TQCString ret=encodedContent(false);
if (scrambleFromLines)
- ret.tqreplace(TQRegExp("\\n\\nFrom "), "\n\n>From ");
+ ret.replace(TQRegExp("\\n\\nFrom "), "\n\n>From ");
ts << ret;
}
@@ -664,14 +664,14 @@ Headers::Generic* Content::getNextHeader(TQCString &head)
bool folded(false);
Headers::Generic *header=0;
- pos1 = head.tqfind(": ");
+ pos1 = head.find(": ");
if (pos1>-1) { //there is another header
pos2=pos1+=2; //skip the name
if (head[pos2]!='\n') { // check if the header is not empty
while(1) {
- pos2=head.tqfind("\n", pos2+1);
+ pos2=head.find("\n", pos2+1);
if(pos2==-1 || pos2==len || ( head[pos2+1]!=' ' && head[pos2+1]!='\t') ) //break if we reach the end of the string, honor folded lines
break;
else
@@ -684,7 +684,7 @@ Headers::Generic* Content::getNextHeader(TQCString &head)
if (!folded)
header = new Headers::Generic(head.left(pos1-2), this, head.mid(pos1, pos2-pos1));
else
- header = new Headers::Generic(head.left(pos1-2), this, head.mid(pos1, pos2-pos1).tqreplace(TQRegExp("\\s*\\n\\s*")," "));
+ header = new Headers::Generic(head.left(pos1-2), this, head.mid(pos1, pos2-pos1).replace(TQRegExp("\\s*\\n\\s*")," "));
head.remove(0,pos2+1);
}
@@ -816,8 +816,8 @@ int Content::lineCount()
{
int ret=0;
if(type()==ATmimeContent)
- ret+=h_ead.tqcontains('\n');
- ret+=b_ody.tqcontains('\n');
+ ret+=h_ead.contains('\n');
+ ret+=b_ody.contains('\n');
if(c_ontents && !c_ontents->isEmpty())
for(Content *c=c_ontents->first(); c; c=c_ontents->next())
diff --git a/libkmime/kmime_content.h b/libkmime/kmime_content.h
index 692f3afe4..1d2aac2d3 100644
--- a/libkmime/kmime_content.h
+++ b/libkmime/kmime_content.h
@@ -110,7 +110,7 @@ class KDE_EXPORT Content : public Base {
void changeEncoding(Headers::contentEncoding e);
//saves the encoded content to the given textstream
- // scrambleFromLines: tqreplace "\nFrom " with "\n>From ", this is
+ // scrambleFromLines: replace "\nFrom " with "\n>From ", this is
// needed to avoid problem with mbox-files
void toStream(TQTextStream &ts, bool scrambleFromLines=false);
diff --git a/libkmime/kmime_headers.cpp b/libkmime/kmime_headers.cpp
index 40a016343..85d4c4049 100644
--- a/libkmime/kmime_headers.cpp
+++ b/libkmime/kmime_headers.cpp
@@ -582,9 +582,9 @@ void AddressField::from7BitString(const TQCString &s)
TQCString n;
//so what do we have here ?
- if(s.tqfind( TQRegExp("*@*(*)", false, true) )!=-1) type=2; // From: foo@bar.com (John Doe)
- else if(s.tqfind( TQRegExp("*<*@*>", false, true) )!=-1) type=1; // From: John Doe <foo@bar.com>
- else if(s.tqfind( TQRegExp("*@*", false, true) )!=-1) type=0; // From: foo@bar.com
+ if(s.find( TQRegExp("*@*(*)", false, true) )!=-1) type=2; // From: foo@bar.com (John Doe)
+ else if(s.find( TQRegExp("*<*@*>", false, true) )!=-1) type=1; // From: John Doe <foo@bar.com>
+ else if(s.find( TQRegExp("*@*", false, true) )!=-1) type=0; // From: foo@bar.com
else { //broken From header => just decode it
n_ame=decodeRFC2047String(s, &e_ncCS, defaultCS(), forceCS());
return;
@@ -598,11 +598,11 @@ void AddressField::from7BitString(const TQCString &s)
case 1:
pos1=0;
- pos2=s.tqfind('<');
+ pos2=s.find('<');
if(pos2!=-1) {
n=s.mid(pos1, pos2-pos1).stripWhiteSpace();
pos1=pos2+1;
- pos2=s.tqfind('>', pos1);
+ pos2=s.find('>', pos1);
if(pos2!=-1)
e_mail=s.mid(pos1, pos2-pos1).stripWhiteSpace();
}
@@ -611,11 +611,11 @@ void AddressField::from7BitString(const TQCString &s)
case 2:
pos1=0;
- pos2=s.tqfind('(');
+ pos2=s.find('(');
if(pos2!=-1) {
e_mail=s.mid(pos1, pos2-pos1).stripWhiteSpace();
pos1=pos2+1;
- pos2=s.tqfind(')', pos1);
+ pos2=s.find(')', pos1);
if(pos2!=-1)
n=s.mid(pos1, pos2-pos1).stripWhiteSpace();
}
@@ -664,9 +664,9 @@ void AddressField::fromUnicodeString(const TQString &s, const TQCString &cs)
e_ncCS=cachedCharset(cs);
//so what do we have here ?
- if(s.tqfind( TQRegExp("*@*(*)", false, true) )!=-1) type=2; // From: foo@bar.com (John Doe)
- else if(s.tqfind( TQRegExp("*<*@*>", false, true) )!=-1) type=1; // From: John Doe <foo@bar.com>
- else if(s.tqfind( TQRegExp("*@*", false, true) )!=-1) type=0; // From: foo@bar.com
+ if(s.find( TQRegExp("*@*(*)", false, true) )!=-1) type=2; // From: foo@bar.com (John Doe)
+ else if(s.find( TQRegExp("*<*@*>", false, true) )!=-1) type=1; // From: John Doe <foo@bar.com>
+ else if(s.find( TQRegExp("*@*", false, true) )!=-1) type=0; // From: foo@bar.com
else { //broken From header => just copy it
n_ame=s;
return;
@@ -680,11 +680,11 @@ void AddressField::fromUnicodeString(const TQString &s, const TQCString &cs)
case 1:
pos1=0;
- pos2=s.tqfind('<');
+ pos2=s.find('<');
if(pos2!=-1) {
n_ame=s.mid(pos1, pos2-pos1).stripWhiteSpace();
pos1=pos2+1;
- pos2=s.tqfind('>', pos1);
+ pos2=s.find('>', pos1);
if(pos2!=-1)
e_mail=s.mid(pos1, pos2-pos1).latin1();
}
@@ -693,11 +693,11 @@ void AddressField::fromUnicodeString(const TQString &s, const TQCString &cs)
case 2:
pos1=0;
- pos2=s.tqfind('(');
+ pos2=s.find('(');
if(pos2!=-1) {
e_mail=s.mid(pos1, pos2-pos1).stripWhiteSpace().latin1();
pos1=pos2+1;
- pos2=s.tqfind(')', pos1);
+ pos2=s.find(')', pos1);
if(pos2!=-1)
n_ame=s.mid(pos1, pos2-pos1).stripWhiteSpace();
}
@@ -978,7 +978,7 @@ TQCString Newsgroups::firstGroup()
{
int pos=0;
if(!g_roups.isEmpty()) {
- pos=g_roups.tqfind(',');
+ pos=g_roups.find(',');
if(pos==-1)
return g_roups;
else
@@ -1107,10 +1107,10 @@ TQCString References::next()
TQCString ret;
if(p_os!=0) {
- pos2=r_ef.tqfindRev('>', p_os);
+ pos2=r_ef.findRev('>', p_os);
p_os=0;
if(pos2!=-1) {
- pos1=r_ef.tqfindRev('<', pos2);
+ pos1=r_ef.findRev('<', pos2);
if(pos1!=-1) {
ret=r_ef.mid(pos1, pos2-pos1+1);
p_os=pos1;
@@ -1129,12 +1129,12 @@ TQCString References::at(unsigned int i)
while(pos1!=-1 && cnt < i+1) {
pos2=pos1-1;
- pos1=r_ef.tqfindRev('<', pos2);
+ pos1=r_ef.findRev('<', pos2);
cnt++;
}
if(pos1!=-1) {
- pos2=r_ef.tqfind('>', pos1);
+ pos2=r_ef.find('>', pos1);
if(pos2!=-1)
ret=r_ef.mid(pos1, pos2-pos1+1);
}
@@ -1154,7 +1154,7 @@ void References::append(const TQCString &s)
// remove bogus references
TQStringList::Iterator it = lst.begin();
while (it != lst.end()) {
- if (-1==(*it).tqfind(exp))
+ if (-1==(*it).find(exp))
it = lst.remove(it);
else
it++;
@@ -1233,7 +1233,7 @@ TQString UserAgent::asUnicodeString()
void ContentType::from7BitString(const TQCString &s)
{
- int pos=s.tqfind(';');
+ int pos=s.find(';');
if(pos==-1)
m_imeType=s.simplifyWhiteSpace();
@@ -1274,7 +1274,7 @@ TQString ContentType::asUnicodeString()
TQCString ContentType::mediaType()
{
- int pos=m_imeType.tqfind('/');
+ int pos=m_imeType.find('/');
if(pos==-1)
return m_imeType;
else
@@ -1284,7 +1284,7 @@ TQCString ContentType::mediaType()
TQCString ContentType::subType()
{
- int pos=m_imeType.tqfind('/');
+ int pos=m_imeType.find('/');
if(pos==-1)
return TQCString();
else
@@ -1453,9 +1453,9 @@ TQCString ContentType::getParameter(const char *name)
{
TQCString ret;
int pos1=0, pos2=0;
- pos1=p_arams.tqfind(name, 0, false);
+ pos1=p_arams.find(name, 0, false);
if(pos1!=-1) {
- if( (pos2=p_arams.tqfind(';', pos1))==-1 )
+ if( (pos2=p_arams.find(';', pos1))==-1 )
pos2=p_arams.length();
pos1+=strlen(name)+1;
ret=p_arams.mid(pos1, pos2-pos1);
@@ -1475,12 +1475,12 @@ void ContentType::setParameter(const TQCString &name, const TQCString &value, bo
else
param=name+"="+value;
- pos1=p_arams.tqfind(name.data(), 0, false);
+ pos1=p_arams.find(name.data(), 0, false);
if(pos1==-1) {
p_arams+="; "+param;
}
else {
- pos2=p_arams.tqfind(';', pos1);
+ pos2=p_arams.find(';', pos1);
if(pos2==-1)
pos2=p_arams.length();
p_arams.remove(pos1, pos2-pos1);
@@ -1559,7 +1559,7 @@ void CDisposition::from7BitString(const TQCString &s)
d_isp=CDattachment;
else d_isp=CDinline;
- int pos=s.tqfind("filename=", 0, false);
+ int pos=s.find("filename=", 0, false);
TQCString fn;
if(pos>-1) {
pos+=9;
@@ -1602,7 +1602,7 @@ void CDisposition::fromUnicodeString(const TQString &s, const TQCString &cs)
d_isp=CDattachment;
else d_isp=CDinline;
- int pos=s.tqfind("filename=", 0, false);
+ int pos=s.find("filename=", 0, false);
if(pos>-1) {
pos+=9;
f_ilename=s.mid(pos, s.length()-pos);
diff --git a/libkmime/kmime_headers.h b/libkmime/kmime_headers.h
index 40ae18b8a..69f139a57 100644
--- a/libkmime/kmime_headers.h
+++ b/libkmime/kmime_headers.h
@@ -605,7 +605,7 @@ class KDE_EXPORT Subject : public Generics::GUnstructured {
virtual const char* type() { return "Subject"; }
bool isReply() {
- return ( asUnicodeString().tqfind( TQString("Re:"), 0, false ) == 0 );
+ return ( asUnicodeString().find( TQString("Re:"), 0, false ) == 0 );
}
};
@@ -651,7 +651,7 @@ class KDE_EXPORT Control : public Base {
virtual bool isEmpty() { return (c_trlMsg.isEmpty()); }
virtual const char* type() { return "Control"; }
- bool isCancel() { return (c_trlMsg.tqfind("cancel", 0, false)!=-1); }
+ bool isCancel() { return (c_trlMsg.find("cancel", 0, false)!=-1); }
protected:
TQCString c_trlMsg;
@@ -708,7 +708,7 @@ class KDE_EXPORT Newsgroups : public Base {
virtual const char* type() { return "Newsgroups"; }
TQCString firstGroup();
- bool isCrossposted() { return ( g_roups.tqfind(',')>-1 ); }
+ bool isCrossposted() { return ( g_roups.find(',')>-1 ); }
TQStringList getGroups();
protected:
diff --git a/libkmime/kmime_mdn.cpp b/libkmime/kmime_mdn.cpp
index 9d654bc78..bba37023c 100644
--- a/libkmime/kmime_mdn.cpp
+++ b/libkmime/kmime_mdn.cpp
@@ -240,9 +240,9 @@ namespace MDN {
// headers that are only present for certain disposition {types,modifiers}:
if ( d == Failed )
result += "Failure: " + encodeRFC2047String( spec, "utf-8" ) + "\n";
- else if ( m.tqcontains( Error ) )
+ else if ( m.contains( Error ) )
result += "Error: " + encodeRFC2047String( spec, "utf-8" ) + "\n";
- else if ( m.tqcontains( Warning ) )
+ else if ( m.contains( Warning ) )
result += "Warning: " + encodeRFC2047String( spec, "utf-8" ) + "\n";
return result;
diff --git a/libkmime/kmime_message.cpp b/libkmime/kmime_message.cpp
index a7ce3ca8a..0d516ecc7 100644
--- a/libkmime/kmime_message.cpp
+++ b/libkmime/kmime_message.cpp
@@ -96,7 +96,7 @@ void Message::assemble()
newHead+=contentTransferEncoding()->as7BitString()+"\n";
//X-Headers
- int pos=h_ead.tqfind("\nX-");
+ int pos=h_ead.find("\nX-");
if(pos>-1) //we already have some x-headers => "recycle" them
newHead+=h_ead.mid(pos+1, h_ead.length()-pos-1);
else if(h_eaders && !h_eaders->isEmpty()) {
diff --git a/libkmime/kmime_newsarticle.cpp b/libkmime/kmime_newsarticle.cpp
index 8989f6a07..1b16ad71f 100644
--- a/libkmime/kmime_newsarticle.cpp
+++ b/libkmime/kmime_newsarticle.cpp
@@ -104,7 +104,7 @@ void NewsArticle::assemble()
newHead+=contentTransferEncoding()->as7BitString()+"\n";
//X-Headers
- int pos=h_ead.tqfind("\nX-");
+ int pos=h_ead.find("\nX-");
if(pos>-1) //we already have some x-headers => "recycle" them
newHead+=h_ead.mid(pos+1, h_ead.length()-pos);
else if(h_eaders && !h_eaders->isEmpty()) {
diff --git a/libkmime/kmime_parsers.cpp b/libkmime/kmime_parsers.cpp
index a7f758bf0..bd07c2375 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.data(), pos1))==-1 || pos1==0 || s_rc[pos1-1]=='\n' ) //valid boundary found or no boundary at all
+ if( (pos1=s_rc.find(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;
}
@@ -56,11 +56,11 @@ bool MultiPart::parse()
while(pos1>-1 && pos2>-1) {
//skip the rest of the line for the first boundary - the message-part starts here
- if( (pos1=s_rc.tqfind('\n', pos1))>-1 ) { //now search the next linebreak
+ if( (pos1=s_rc.find('\n', pos1))>-1 ) { //now search the next linebreak
//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.data(), pos2))==-1 || s_rc[pos2-1]=='\n' ) //valid boundary or no more boundaries found
+ if( (pos2=s_rc.find(b.data(), pos2))==-1 || s_rc[pos2-1]=='\n' ) //valid boundary or no more boundaries found
break;
pos2+=blen; //boundary is invalid => skip it;
}
@@ -77,7 +77,7 @@ bool MultiPart::parse()
pos2+=blen; //pos2 points now to the first charakter after the boundary
if(s_rc[pos2]=='-' && s_rc[pos2+1]=='-') { //end-boundary
pos1=pos2+2; //pos1 points now to the character directly after the end-boundary
- if( (pos1=s_rc.tqfind('\n', pos1))>-1 ) //skipt the rest of this line
+ if( (pos1=s_rc.find('\n', pos1))>-1 ) //skipt the rest of this line
e_pilouge=s_rc.mid(pos1+1, s_rc.length()-pos1-1); //everything after the end-boundary is considered as the epilouge
pos1=-1;
pos2=-1; //break
@@ -108,7 +108,7 @@ TQCString NonMimeParser::guessMimeType(const TQCString& fileName)
int pos;
if(!fileName.isEmpty()) {
- pos=fileName.tqfindRev('.');
+ pos=fileName.findRev('.');
if(pos++ != -1) {
tmp=fileName.mid(pos, fileName.length()-pos).upper();
if(tmp=="JPG" || tmp=="JPEG") mimeType="image/jpeg";
@@ -152,9 +152,9 @@ bool UUEncoded::parse()
bool containsBegin=false, containsEnd=false;
TQCString tmp,fileName;
- if( (beginPos=s_rc.tqfind(TQRegExp("begin [0-9][0-9][0-9]"),currentPos))>-1 && (beginPos==0 || s_rc.at(beginPos-1)=='\n') ) {
+ if( (beginPos=s_rc.find(TQRegExp("begin [0-9][0-9][0-9]"),currentPos))>-1 && (beginPos==0 || s_rc.at(beginPos-1)=='\n') ) {
containsBegin=true;
- uuStart=s_rc.tqfind('\n', beginPos);
+ uuStart=s_rc.find('\n', beginPos);
if(uuStart==-1) {//no more line breaks found, we give up
success = false;
break;
@@ -163,7 +163,7 @@ bool UUEncoded::parse()
}
else beginPos=currentPos;
- if ( (endPos=s_rc.tqfind("\nend",(uuStart>0)? uuStart-1:0))==-1 )
+ if ( (endPos=s_rc.find("\nend",(uuStart>0)? uuStart-1:0))==-1 )
endPos=s_rc.length(); //no end found
else
containsEnd=true;
@@ -194,7 +194,7 @@ bool UUEncoded::parse()
len=rx.matchedLength();
if(pos!=-1) {
tmp=s_ubject.mid(pos, len);
- pos=tmp.tqfind('/');
+ pos=tmp.find('/');
p_artNr=tmp.left(pos).toInt();
t_otalNr=tmp.right(tmp.length()-pos-1).toInt();
} else {
@@ -216,7 +216,7 @@ bool UUEncoded::parse()
m_imeTypes.append(guessMimeType(fileName));
firstIteration=false;
- int next = s_rc.tqfind('\n', endPos+1);
+ int next = s_rc.find('\n', endPos+1);
if(next==-1) { //no more line breaks found, we give up
success = false;
break;
@@ -249,19 +249,19 @@ bool YENCEncoded::yencMeta(TQCString& src, const TQCString& name, int* value)
bool found = false;
TQCString sought=name + "=";
- int iPos=src.tqfind( sought.data() );
+ int iPos=src.find( sought.data() );
if (iPos>-1) {
- int pos1=src.tqfind(' ', iPos);
- int pos2=src.tqfind('\r', iPos);
- int pos3=src.tqfind('\t', iPos);
- int pos4=src.tqfind('\n', iPos);
+ int pos1=src.find(' ', iPos);
+ int pos2=src.find('\r', iPos);
+ int pos3=src.find('\t', iPos);
+ int pos4=src.find('\n', iPos);
if (pos2>=0 && (pos1<0 || pos1>pos2))
pos1=pos2;
if (pos3>=0 && (pos1<0 || pos1>pos3))
pos1=pos3;
if (pos4>=0 && (pos1<0 || pos1>pos4))
pos1=pos4;
- iPos=src.tqfindRev( '=', pos1)+1;
+ iPos=src.findRev( '=', pos1)+1;
if (iPos<pos1) {
char c=src.at( iPos);
if ( c>='0' && c<='9') {
@@ -284,16 +284,16 @@ bool YENCEncoded::parse()
bool containsPart=false;
TQCString fileName,mimeType;
- if ((beginPos=s_rc.tqfind("=ybegin ", currentPos))>-1 && ( beginPos==0 || s_rc.at( beginPos-1)=='\n') ) {
- yencStart=s_rc.tqfind( '\n', beginPos);
+ if ((beginPos=s_rc.find("=ybegin ", currentPos))>-1 && ( beginPos==0 || s_rc.at( beginPos-1)=='\n') ) {
+ yencStart=s_rc.find( '\n', beginPos);
if (yencStart==-1) { // no more line breaks found, give up
success = false;
break;
} else {
yencStart++;
- if (s_rc.tqfind("=ypart", yencStart)==yencStart) {
+ if (s_rc.find("=ypart", yencStart)==yencStart) {
containsPart=true;
- yencStart=s_rc.tqfind( '\n', yencStart);
+ yencStart=s_rc.find( '\n', yencStart);
if ( yencStart== -1) {
success=false;
break;
@@ -305,14 +305,14 @@ bool YENCEncoded::parse()
// Filenames can contain any embedded chars until end of line
TQCString meta=s_rc.mid(beginPos, yencStart-beginPos);
- int namePos=meta.tqfind("name=");
+ int namePos=meta.find("name=");
if (namePos== -1) {
success=false;
break;
}
- int eolPos=meta.tqfind('\r', namePos);
+ int eolPos=meta.find('\r', namePos);
if (eolPos== -1)
- eolPos=meta.tqfind('\n', namePos);
+ eolPos=meta.find('\n', namePos);
if (eolPos== -1) {
success=false;
break;
@@ -424,7 +424,7 @@ bool YENCEncoded::parse()
}
// pos now points to =yend; get end data
- eolPos=s_rc.tqfind('\n', pos);
+ eolPos=s_rc.find('\n', pos);
if (eolPos== -1)
{
success=false;
diff --git a/libkmime/kmime_util.cpp b/libkmime/kmime_util.cpp
index 6fea9fc84..624e0dae3 100644
--- a/libkmime/kmime_util.cpp
+++ b/libkmime/kmime_util.cpp
@@ -48,7 +48,7 @@ TQStrIList l_anguageCache;
const char* cachedCharset(const TQCString &name)
{
- int idx=c_harsetCache.tqfind(name.data());
+ int idx=c_harsetCache.find(name.data());
if(idx>-1)
return c_harsetCache.at(idx);
@@ -59,7 +59,7 @@ const char* cachedCharset(const TQCString &name)
const char* cachedLanguage(const TQCString &name)
{
- int idx=l_anguageCache.tqfind(name.data());
+ int idx=l_anguageCache.find(name.data());
if(idx>-1)
return l_anguageCache.at(idx);
@@ -134,7 +134,7 @@ TQString decodeRFC2047String(const TQCString &src, const char **usedCS,
const int maxLen=400;
int i;
- if(src.tqfind("=?") < 0)
+ if(src.find("=?") < 0)
result = src.copy();
else {
result.truncate(src.length());
@@ -262,7 +262,7 @@ TQCString encodeRFC2047String(const TQString &src, const char *charset,
codec=KGlobal::charsets()->codecForName(usedCS, ok);
}
- if (usedCS.tqfind("8859-")>=0) // use "B"-Encoding for non iso-8859-x charsets
+ if (usedCS.find("8859-")>=0) // use "B"-Encoding for non iso-8859-x charsets
useTQEncoding=true;
encoded8Bit=codec->fromUnicode(src);
@@ -377,7 +377,7 @@ TQCString extractHeader(const TQCString &src, const char *name)
pos1 = 0;
} else {
n.prepend("\n");
- pos1 = src.tqfind(n.data(),0,false);
+ pos1 = src.find(n.data(),0,false);
}
if (pos1>-1) { //there is a header with the given name
@@ -389,7 +389,7 @@ TQCString extractHeader(const TQCString &src, const char *name)
if (src[pos2]!='\n') { // check if the header is not empty
while(1) {
- pos2=src.tqfind("\n", pos2+1);
+ pos2=src.find("\n", pos2+1);
if(pos2==-1 || pos2==len || ( src[pos2+1]!=' ' && src[pos2+1]!='\t') ) //break if we reach the end of the string, honor folded lines
break;
else
@@ -402,7 +402,7 @@ TQCString extractHeader(const TQCString &src, const char *name)
if (!folded)
return src.mid(pos1, pos2-pos1);
else
- return (src.mid(pos1, pos2-pos1).tqreplace(TQRegExp("\\s*\\n\\s*")," "));
+ return (src.mid(pos1, pos2-pos1).replace(TQRegExp("\\s*\\n\\s*")," "));
}
else {
return TQCString(0); //header not found
@@ -413,7 +413,7 @@ TQCString extractHeader(const TQCString &src, const char *name)
TQCString CRLFtoLF(const TQCString &s)
{
TQCString ret=s.copy();
- ret.tqreplace(TQRegExp("\\r\\n"), "\n");
+ ret.replace(TQRegExp("\\r\\n"), "\n");
return ret;
}
@@ -421,7 +421,7 @@ TQCString CRLFtoLF(const TQCString &s)
TQCString CRLFtoLF(const char *s)
{
TQCString ret=s;
- ret.tqreplace(TQRegExp("\\r\\n"), "\n");
+ ret.replace(TQRegExp("\\r\\n"), "\n");
return ret;
}
@@ -429,7 +429,7 @@ TQCString CRLFtoLF(const char *s)
TQCString LFtoCRLF(const TQCString &s)
{
TQCString ret=s.copy();
- ret.tqreplace(TQRegExp("\\n"), "\r\n");
+ ret.replace(TQRegExp("\\n"), "\r\n");
return ret;
}
@@ -559,13 +559,13 @@ DateFormatter::custom(time_t t) const
if ( mCustomFormat.isEmpty() )
return TQString();
- int z = mCustomFormat.tqfind("Z");
+ int z = mCustomFormat.find("Z");
TQDateTime d;
TQString ret = mCustomFormat;
d.setTime_t(t);
if ( z != -1 ) {
- ret.tqreplace(z,1,zone(t));
+ ret.replace(z,1,zone(t));
}
ret = d.toString(ret);
diff --git a/libkmime/kqcstringsplitter.cpp b/libkmime/kqcstringsplitter.cpp
index d406691c3..b97ddb979 100644
--- a/libkmime/kqcstringsplitter.cpp
+++ b/libkmime/kqcstringsplitter.cpp
@@ -52,7 +52,7 @@ bool KTQCStringSplitter::first()
start=0;
- end=src.tqfind(sep.data(), start);
+ end=src.find(sep.data(), start);
if(end!=-1) {
dst=src.mid(start, end);
@@ -83,7 +83,7 @@ bool KTQCStringSplitter::last()
end=src.length();
- start=src.tqfindRev(sep.data(),end);
+ start=src.findRev(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.data(), start);
+ end=src.find(sep.data(), start);
if(end!=-1) {
dst=src.mid(start, end-start);
@@ -142,7 +142,7 @@ bool KTQCStringSplitter::prev()
if(end>0) {
- start=src.tqfindRev(sep.data(),end);
+ start=src.findRev(sep.data(),end);
if(start!=-1)
dst=src.mid(start, end-start);
diff --git a/libkmime/tests/run_codec_tests b/libkmime/tests/run_codec_tests
index 62f5f2d60..62908eeec 100755
--- a/libkmime/tests/run_codec_tests
+++ b/libkmime/tests/run_codec_tests
@@ -19,7 +19,7 @@ failedTests=0
# loop over all .expected files in the directory
# specified by the single argument:
-for i in $(tqfind "$@" -type f -name '*.expected'); do
+for i in $(find "$@" -type f -name '*.expected'); do
dirName="$(dirname "$i")"
if [ "$dirName" != "$oldDirName" ]; then
oldDirName="$dirName"