summaryrefslogtreecommitdiffstats
path: root/kopete/libkopete/kopetemessage.cpp
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
commit937b2991d8e78166eea904c80ad04d34607017a4 (patch)
tree2accb8161eab09df5d7a5484ea9ea080ad123168 /kopete/libkopete/kopetemessage.cpp
parentdba26cb985af370c33d1767037851705cc561726 (diff)
downloadtdenetwork-937b2991d8e78166eea904c80ad04d34607017a4.tar.gz
tdenetwork-937b2991d8e78166eea904c80ad04d34607017a4.zip
rename the following methods:
tqfind find tqreplace replace tqcontains contains git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/libkopete/kopetemessage.cpp')
-rw-r--r--kopete/libkopete/kopetemessage.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/kopete/libkopete/kopetemessage.cpp b/kopete/libkopete/kopetemessage.cpp
index db3b24ef..0dfedd69 100644
--- a/kopete/libkopete/kopetemessage.cpp
+++ b/kopete/libkopete/kopetemessage.cpp
@@ -199,20 +199,20 @@ void Message::doSetBody( const TQString &_body, Message::MessageFormat f )
{
//This is coming from the RichTextEditor component.
//Strip off the containing HTML document
- body.tqreplace( TQRegExp( TQString::tqfromLatin1(".*<body[^>]*>(.*)</body>.*") ), TQString::tqfromLatin1("\\1") );
+ body.replace( TQRegExp( TQString::tqfromLatin1(".*<body[^>]*>(.*)</body>.*") ), TQString::tqfromLatin1("\\1") );
//Strip <p> tags
- body.tqreplace( TQString::tqfromLatin1("<p>"), TQString() );
+ body.replace( TQString::tqfromLatin1("<p>"), TQString() );
//Replace </p> with a <br/>
- body.tqreplace( TQString::tqfromLatin1("</p>"), TQString::tqfromLatin1("<br/>") );
+ body.replace( TQString::tqfromLatin1("</p>"), TQString::tqfromLatin1("<br/>") );
//Remove trailing </br>
if ( body.endsWith( TQString::tqfromLatin1("<br/>") ) )
body.truncate( body.length() - 5 );
body.remove( TQString::tqfromLatin1("\n") );
- body.tqreplace( TQRegExp( TQString::tqfromLatin1( "\\s\\s" ) ), TQString::tqfromLatin1( " &nbsp;" ) );
+ body.replace( TQRegExp( TQString::tqfromLatin1( "\\s\\s" ) ), TQString::tqfromLatin1( " &nbsp;" ) );
}
/*
else if( f == ParsedHTML )
@@ -255,23 +255,23 @@ TQString Message::unescape( const TQString &xml )
data.simplifyWhiteSpace();
int pos;
- while ( ( pos = data.tqfind( '<' ) ) != -1 )
+ while ( ( pos = data.find( '<' ) ) != -1 )
{
- int endPos = data.tqfind( '>', pos + 1 );
+ int endPos = data.find( '>', pos + 1 );
if( endPos == -1 )
break; // No more complete elements left
// Take the part between < and >, and extract the element name from that
int matchWidth = endPos - pos + 1;
TQString match = data.mid( pos + 1, matchWidth - 2 ).simplifyWhiteSpace();
- int elemEndPos = match.tqfind( ' ' );
+ int elemEndPos = match.find( ' ' );
TQString elem = ( elemEndPos == -1 ? match.lower() : match.left( elemEndPos ).lower() );
if ( elem == TQString::tqfromLatin1( "img" ) )
{
// Replace smileys with their original text'
const TQString attrTitle = TQString::tqfromLatin1( "title=\"" );
- int titlePos = match.tqfind( attrTitle, elemEndPos );
- int titleEndPos = match.tqfind( '"', titlePos + attrTitle.length() );
+ int titlePos = match.find( attrTitle, elemEndPos );
+ int titleEndPos = match.find( '"', titlePos + attrTitle.length() );
if( titlePos == -1 || titleEndPos == -1 )
{
// Not a smiley but a normal <img>
@@ -282,7 +282,7 @@ TQString Message::unescape( const TQString &xml )
{
TQString orig = match.mid( titlePos + attrTitle.length(),
titleEndPos - titlePos - attrTitle.length() );
- data.tqreplace( pos, matchWidth, orig );
+ data.replace( pos, matchWidth, orig );
pos += orig.length();
}
}
@@ -290,7 +290,7 @@ TQString Message::unescape( const TQString &xml )
elem == TQString::tqfromLatin1( "br" ) )
{
// Replace paragraph, div and line breaks with a newline
- data.tqreplace( pos, matchWidth, '\n' );
+ data.replace( pos, matchWidth, '\n' );
pos++;
}
else
@@ -302,12 +302,12 @@ TQString Message::unescape( const TQString &xml )
}
// Replace stuff starting with '&'
- data.tqreplace( TQString::tqfromLatin1( "&gt;" ), TQString::tqfromLatin1( ">" ) );
- data.tqreplace( TQString::tqfromLatin1( "&lt;" ), TQString::tqfromLatin1( "<" ) );
- data.tqreplace( TQString::tqfromLatin1( "&quot;" ), TQString::tqfromLatin1( "\"" ) );
- data.tqreplace( TQString::tqfromLatin1( "&nbsp;" ), TQString::tqfromLatin1( " " ) );
- data.tqreplace( TQString::tqfromLatin1( "&amp;" ), TQString::tqfromLatin1( "&" ) );
- data.tqreplace( TQString::tqfromLatin1( "&#160;" ), TQString::tqfromLatin1( " " ) ); //this one is used in jabber: note, we should escape all &#xx;
+ data.replace( TQString::tqfromLatin1( "&gt;" ), TQString::tqfromLatin1( ">" ) );
+ data.replace( TQString::tqfromLatin1( "&lt;" ), TQString::tqfromLatin1( "<" ) );
+ data.replace( TQString::tqfromLatin1( "&quot;" ), TQString::tqfromLatin1( "\"" ) );
+ data.replace( TQString::tqfromLatin1( "&nbsp;" ), TQString::tqfromLatin1( " " ) );
+ data.replace( TQString::tqfromLatin1( "&amp;" ), TQString::tqfromLatin1( "&" ) );
+ data.replace( TQString::tqfromLatin1( "&#160;" ), TQString::tqfromLatin1( " " ) ); //this one is used in jabber: note, we should escape all &#xx;
return data;
}
@@ -316,13 +316,13 @@ TQString Message::escape( const TQString &text )
{
TQString html = TQStyleSheet::escape( text );
//Replace carriage returns inside the text
- html.tqreplace( TQString::tqfromLatin1( "\n" ), TQString::tqfromLatin1( "<br />" ) );
+ html.replace( TQString::tqfromLatin1( "\n" ), TQString::tqfromLatin1( "<br />" ) );
//Replace a tab with 4 spaces
- html.tqreplace( TQString::tqfromLatin1( "\t" ), TQString::tqfromLatin1( "&nbsp;&nbsp;&nbsp;&nbsp;" ) );
+ html.replace( TQString::tqfromLatin1( "\t" ), TQString::tqfromLatin1( "&nbsp;&nbsp;&nbsp;&nbsp;" ) );
//Replace multiple spaces with &nbsp;
//do not replace every space so we break the linebreak
- html.tqreplace( TQRegExp( TQString::tqfromLatin1( "\\s\\s" ) ), TQString::tqfromLatin1( "&nbsp; " ) );
+ html.replace( TQRegExp( TQString::tqfromLatin1( "\\s\\s" ) ), TQString::tqfromLatin1( "&nbsp; " ) );
return html;
}
@@ -403,7 +403,7 @@ TQString Message::parseLinks( const TQString &message, MessageFormat format )
{
TQString curr = *it;
// > in HTML means start-of-tag if and only if it's the first one after a <
- int tagclose = curr.tqfind( TQChar('>') );
+ int tagclose = curr.find( TQChar('>') );
// no >: the HTML is broken, but we can cope
if ( tagclose == -1 )
continue;
@@ -425,24 +425,24 @@ TQString Message::parseLinks( const TQString &message, MessageFormat format )
//Replace http/https/ftp links:
// Replace (stuff)://[user:password@](linkstuff) with a link
- result.tqreplace(
+ result.replace(
TQRegExp( makeRegExp("\\w+://%1?\\w%2").tqarg( userAndPassword, urlSection ) ),
TQString::tqfromLatin1("\\1<a href=\"\\2\" title=\"\\2\">\\2</a>\\3" ) );
// Replace www.X.Y(linkstuff) with a http: link
- result.tqreplace(
+ result.replace(
TQRegExp( makeRegExp("%1?www\\.%2%3").tqarg( userAndPassword, domain, urlSection ) ),
TQString::tqfromLatin1("\\1<a href=\"http://\\2\" title=\"http://\\2\">\\2</a>\\3" ) );
//Replace Email Links
// Replace user@domain with a mailto: link
- result.tqreplace(
+ result.replace(
TQRegExp( makeRegExp("%1@%2").tqarg( name, domain ) ),
TQString::tqfromLatin1("\\1<a href=\"mailto:\\2\" title=\"mailto:\\2\">\\2</a>\\3") );
//Workaround for Bug 85061: Highlighted URLs adds a ' ' after the URL itself
// the trailing &nbsp; is included in the url.
- result.tqreplace( TQRegExp( TQString::tqfromLatin1("(<a href=\"[^\"]+)(&nbsp;)(\")") ) , TQString::tqfromLatin1("\\1\\3") );
+ result.replace( TQRegExp( TQString::tqfromLatin1("(<a href=\"[^\"]+)(&nbsp;)(\")") ) , TQString::tqfromLatin1("\\1\\3") );
return result;
}