diff options
Diffstat (limited to 'kopete/protocols/gadu/gadurichtextformat.cpp')
-rw-r--r-- | kopete/protocols/gadu/gadurichtextformat.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/kopete/protocols/gadu/gadurichtextformat.cpp b/kopete/protocols/gadu/gadurichtextformat.cpp index fd567bf6..9e46b967 100644 --- a/kopete/protocols/gadu/gadurichtextformat.cpp +++ b/kopete/protocols/gadu/gadurichtextformat.cpp @@ -37,7 +37,7 @@ GaduRichTextFormat::~GaduRichTextFormat() { } -QString +TQString GaduRichTextFormat::convertToHtml( const TQString& msg, unsigned int formats, void* formatStructure) { TQString tmp, nb; @@ -100,9 +100,9 @@ GaduRichTextFormat::convertToHtml( const TQString& msg, unsigned int formats, vo g = (int)color->green; b = (int)color->blue; } - style += TQString(" color: rgb( %1, %2, %3 ); ").arg( r ).arg( g ).arg( b ); + style += TQString(" color: rgb( %1, %2, %3 ); ").tqarg( r ).tqarg( g ).tqarg( b ); - tmp += formatOpeningTag( TQString::fromLatin1("span"), TQString::fromLatin1("style=\"%1\"").arg( style ) ); + tmp += formatOpeningTag( TQString::tqfromLatin1("span"), TQString::tqfromLatin1("style=\"%1\"").tqarg( style ) ); opened = true; } @@ -121,7 +121,7 @@ GaduRichTextFormat::convertToHtml( const TQString& msg, unsigned int formats, vo return tmp; } -QString +TQString GaduRichTextFormat::formatOpeningTag( const TQString& tag, const TQString& attributes ) { TQString res = "<" + tag; @@ -130,7 +130,7 @@ GaduRichTextFormat::formatOpeningTag( const TQString& tag, const TQString& attri return res + ">"; } -QString +TQString GaduRichTextFormat::formatClosingTag( const TQString& tag ) { return "</" + tag + ">"; @@ -150,8 +150,8 @@ GaduRichTextFormat::convertToGaduMessage( const Kopete::Message& message ) output->rtf.resize(0); // test first if there is any HTML formating in it - if( htmlString.find( TQString::fromLatin1("</span") ) > -1 ) { - TQRegExp findTags( TQString::fromLatin1("<span style=\"(.*)\">(.*)</span>") ); + if( htmlString.tqfind( TQString::tqfromLatin1("</span") ) > -1 ) { + TQRegExp findTags( TQString::tqfromLatin1("<span style=\"(.*)\">(.*)</span>") ); findTags.setMinimal( true ); int pos = 0; int lastpos = 0; @@ -198,8 +198,8 @@ GaduRichTextFormat::convertToGaduMessage( const Kopete::Message& message ) return NULL; } - TQString rep = TQString("<span style=\"%1\">%2</span>" ).arg( styleHTML ).arg( replacement ); - htmlString.replace( findTags.pos( 0 ), rep.length(), replacement ); + TQString rep = TQString("<span style=\"%1\">%2</span>" ).tqarg( styleHTML ).tqarg( replacement ); + htmlString.tqreplace( findTags.pos( 0 ), rep.length(), replacement ); replacement = unescapeGaduMessage( replacement ); output->message += replacement; @@ -226,26 +226,26 @@ GaduRichTextFormat::convertToGaduMessage( const Kopete::Message& message ) void GaduRichTextFormat::parseAttributes( const TQString attribute, const TQString value ) { - if( attribute == TQString::fromLatin1("color") ) { + if( attribute == TQString::tqfromLatin1("color") ) { color.setNamedColor( value ); } - if( attribute == TQString::fromLatin1("font-weight") && value == TQString::fromLatin1("600") ) { + if( attribute == TQString::tqfromLatin1("font-weight") && value == TQString::tqfromLatin1("600") ) { rtfs.font |= GG_FONT_BOLD; } - if( attribute == TQString::fromLatin1("text-decoration") && value == TQString::fromLatin1("underline") ) { + if( attribute == TQString::tqfromLatin1("text-decoration") && value == TQString::tqfromLatin1("underline") ) { rtfs.font |= GG_FONT_UNDERLINE ; } - if( attribute == TQString::fromLatin1("font-style") && value == TQString::fromLatin1("italic") ) { + if( attribute == TQString::tqfromLatin1("font-style") && value == TQString::tqfromLatin1("italic") ) { rtfs.font |= GG_FONT_ITALIC; } } -QString +TQString GaduRichTextFormat::unescapeGaduMessage( TQString& ns ) { TQString s; s = Kopete::Message::unescape( ns ); - s.replace( TQString::fromAscii( "\n" ), TQString::fromAscii( "\r\n" ) ); + s.tqreplace( TQString::fromAscii( "\n" ), TQString::fromAscii( "\r\n" ) ); return s; } @@ -263,14 +263,14 @@ GaduRichTextFormat::insertRtf( uint position) // append font description rtfs.position = position; uint csize = rtf.size(); - if ( rtf.resize( csize + sizeof( gg_msg_richtext_format ) ) == FALSE ) { + if ( rtf.tqresize( csize + sizeof( gg_msg_richtext_format ) ) == FALSE ) { return false; }; memcpy( rtf.data() + csize, &rtfs, sizeof( rtfs ) ); // append color description, if color has changed if ( rtfs.font & GG_FONT_COLOR ) { csize = rtf.size(); - if ( rtf.resize( csize + sizeof( gg_msg_richtext_color ) ) == FALSE ) { + if ( rtf.tqresize( csize + sizeof( gg_msg_richtext_color ) ) == FALSE ) { return false; }; memcpy( rtf.data() + csize, &rtcs, sizeof( rtcs ) ); @@ -279,13 +279,13 @@ GaduRichTextFormat::insertRtf( uint position) return true; } -QString +TQString GaduRichTextFormat::escapeBody( TQString& input ) { - input.replace( '<', TQString::fromLatin1("<") ); - input.replace( '>', TQString::fromLatin1(">") ); - input.replace( '\n', TQString::fromLatin1( "<br />" ) ); - input.replace( '\t', TQString::fromLatin1( " " ) ); - input.replace( TQRegExp( TQString::fromLatin1( "\\s\\s" ) ), TQString::fromLatin1( " " ) ); + input.tqreplace( '<', TQString::tqfromLatin1("<") ); + input.tqreplace( '>', TQString::tqfromLatin1(">") ); + input.tqreplace( '\n', TQString::tqfromLatin1( "<br />" ) ); + input.tqreplace( '\t', TQString::tqfromLatin1( " " ) ); + input.tqreplace( TQRegExp( TQString::tqfromLatin1( "\\s\\s" ) ), TQString::tqfromLatin1( " " ) ); return input; } |