diff options
Diffstat (limited to 'kopete/protocols/yahoo/yahooaccount.cpp')
-rw-r--r-- | kopete/protocols/yahoo/yahooaccount.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/kopete/protocols/yahoo/yahooaccount.cpp b/kopete/protocols/yahoo/yahooaccount.cpp index 315b4d45..93395746 100644 --- a/kopete/protocols/yahoo/yahooaccount.cpp +++ b/kopete/protocols/yahoo/yahooaccount.cpp @@ -167,16 +167,16 @@ TQString YahooAccount::stripMsgColorCodes(const TQString& msg) TQString filteredMsg = msg; //Handle bold, underline and italic messages - filteredMsg.tqreplace( "\033[1m", "<b>" ); - filteredMsg.tqreplace( "\033[x1m", "</b>" ); - filteredMsg.tqreplace( "\033[2m", "<i>" ); - filteredMsg.tqreplace( "\033[x2m", "</i>" ); - filteredMsg.tqreplace( "\033[4m", "<u>" ); - filteredMsg.tqreplace( "\033[x4m", "</u>" ); + filteredMsg.replace( "\033[1m", "<b>" ); + filteredMsg.replace( "\033[x1m", "</b>" ); + filteredMsg.replace( "\033[2m", "<i>" ); + filteredMsg.replace( "\033[x2m", "</i>" ); + filteredMsg.replace( "\033[4m", "<u>" ); + filteredMsg.replace( "\033[x4m", "</u>" ); //GAIM doesn't check for ^[[3m. Does this ever get sent? - filteredMsg.tqreplace( "\033[3m", "<i>" ); - filteredMsg.tqreplace( "\033[x3m", "</i>" ); + filteredMsg.replace( "\033[3m", "<i>" ); + filteredMsg.replace( "\033[x3m", "</i>" ); //Strip link tags filteredMsg.remove( "\033[lm" ); @@ -196,26 +196,26 @@ TQColor YahooAccount::getMsgColor(const TQString& msg) //kdDebug(YAHOO_GEN_DEBUG) << "msg is " << msg; //Please note that some of the colors are hard-coded to //match the yahoo colors - if ( msg.tqfind("\033[38m") != -1 ) + if ( msg.find("\033[38m") != -1 ) return TQt::red; - if ( msg.tqfind("\033[34m") != -1 ) + if ( msg.find("\033[34m") != -1 ) return TQt::green; - if ( msg.tqfind("\033[31m") != -1 ) + if ( msg.find("\033[31m") != -1 ) return TQt::blue; - if ( msg.tqfind("\033[39m") != -1 ) + if ( msg.find("\033[39m") != -1 ) return TQt::yellow; - if ( msg.tqfind("\033[36m") != -1 ) + if ( msg.find("\033[36m") != -1 ) return TQt::darkMagenta; - if ( msg.tqfind("\033[32m") != -1 ) + if ( msg.find("\033[32m") != -1 ) return TQt::cyan; - if ( msg.tqfind("\033[37m") != -1 ) + if ( msg.find("\033[37m") != -1 ) return TQColor("#FFAA39"); - if ( msg.tqfind("\033[35m") != -1 ) + if ( msg.find("\033[35m") != -1 ) return TQColor("#FFD8D8"); - if ( msg.tqfind("\033[#") != -1 ) + if ( msg.find("\033[#") != -1 ) { - kdDebug(YAHOO_GEN_DEBUG) << "Custom color is " << msg.mid(msg.tqfind("\033[#")+2,7) << endl; - return TQColor(msg.mid(msg.tqfind("\033[#")+2,7)); + kdDebug(YAHOO_GEN_DEBUG) << "Custom color is " << msg.mid(msg.find("\033[#")+2,7) << endl; + return TQColor(msg.mid(msg.find("\033[#")+2,7)); } //return a default value just in case @@ -1053,7 +1053,7 @@ TQString YahooAccount::prepareIncomingMessage( const TQString &messageText ) kdDebug(YAHOO_GEN_DEBUG) << "Message after stripping color codes '" << newMsgText << "'" << endl; - newMsgText.tqreplace( TQString::tqfromLatin1( "&" ), TQString::tqfromLatin1( "&" ) ); + newMsgText.replace( TQString::tqfromLatin1( "&" ), TQString::tqfromLatin1( "&" ) ); // Replace Font tags regExp.setMinimal( true ); @@ -1063,7 +1063,7 @@ TQString YahooAccount::prepareIncomingMessage( const TQString &messageText ) pos = regExp.search( newMsgText, pos ); if ( pos >= 0 ) { pos += regExp.matchedLength(); - newMsgText.tqreplace( regExp, TQString::tqfromLatin1("<font\\1style=\"font-size:\\2pt\">" ) ); + newMsgText.replace( regExp, TQString::tqfromLatin1("<font\\1style=\"font-size:\\2pt\">" ) ); } } @@ -1095,7 +1095,7 @@ TQString YahooAccount::prepareIncomingMessage( const TQString &messageText ) pos = regExp.search( newMsgText, pos ); if ( pos >= 0 ) { pos += regExp.matchedLength(); - newMsgText.tqreplace( regExp, TQString::tqfromLatin1("<" ) ); + newMsgText.replace( regExp, TQString::tqfromLatin1("<" ) ); } } regExp.setPattern( "([^\"bui])>" ); @@ -1104,22 +1104,22 @@ TQString YahooAccount::prepareIncomingMessage( const TQString &messageText ) pos = regExp.search( newMsgText, pos ); if ( pos >= 0 ) { pos += regExp.matchedLength(); - newMsgText.tqreplace( regExp, TQString::tqfromLatin1("\\1>" ) ); + newMsgText.replace( regExp, TQString::tqfromLatin1("\\1>" ) ); } } // add closing tags when needed regExp.setMinimal( false ); regExp.setPattern( "(<b>.*)(?!</b>)" ); - newMsgText.tqreplace( regExp, TQString::tqfromLatin1("\\1</b>" ) ); + newMsgText.replace( regExp, TQString::tqfromLatin1("\\1</b>" ) ); regExp.setPattern( "(<i>.*)(?!</i>)" ); - newMsgText.tqreplace( regExp, TQString::tqfromLatin1("\\1</i>" ) ); + newMsgText.replace( regExp, TQString::tqfromLatin1("\\1</i>" ) ); regExp.setPattern( "(<u>.*)(?!</u>)" ); - newMsgText.tqreplace( regExp, TQString::tqfromLatin1("\\1</u>" ) ); + newMsgText.replace( regExp, TQString::tqfromLatin1("\\1</u>" ) ); regExp.setPattern( "(<font.*)(?!</font>)" ); - newMsgText.tqreplace( regExp, TQString::tqfromLatin1("\\1</font>" ) ); + newMsgText.replace( regExp, TQString::tqfromLatin1("\\1</font>" ) ); - newMsgText.tqreplace( TQString::tqfromLatin1( "\r" ), TQString::tqfromLatin1( "<br/>" ) ); + newMsgText.replace( TQString::tqfromLatin1( "\r" ), TQString::tqfromLatin1( "<br/>" ) ); return newMsgText; } @@ -1208,7 +1208,7 @@ void YahooAccount::slotGotConfInvite( const TQString & who, const TQString & roo kdDebug(YAHOO_GEN_DEBUG) << who << " has invited you to join the conference \"" << room << "\" : " << msg << endl; kdDebug(YAHOO_GEN_DEBUG) << "Members: " << members << endl; - if( !m_pendingConfInvites.tqcontains( room ) ) // We have to keep track of the invites as the server will send the same invite twice if it gets canceled by the host + if( !m_pendingConfInvites.contains( room ) ) // We have to keep track of the invites as the server will send the same invite twice if it gets canceled by the host m_pendingConfInvites.push_back( room ); else { @@ -1321,7 +1321,7 @@ void YahooAccount::slotConfUserDecline( const TQString &who, const TQString &roo { kdDebug(YAHOO_GEN_DEBUG) ; - if( !m_conferences.tqcontains( room ) ) + if( !m_conferences.contains( room ) ) { kdDebug(YAHOO_GEN_DEBUG) << "Error. No chatsession for this conference found." << endl; return; @@ -1338,7 +1338,7 @@ void YahooAccount::slotConfUserDecline( const TQString &who, const TQString &roo void YahooAccount::slotConfUserJoin( const TQString &who, const TQString &room ) { kdDebug(YAHOO_GEN_DEBUG) ; - if( !m_conferences.tqcontains( room ) ) + if( !m_conferences.contains( room ) ) { kdDebug(YAHOO_GEN_DEBUG) << "Error. No chatsession for this conference found." << endl; return; @@ -1355,7 +1355,7 @@ void YahooAccount::slotConfUserJoin( const TQString &who, const TQString &room ) void YahooAccount::slotConfUserLeave( const TQString & who, const TQString &room ) { kdDebug(YAHOO_GEN_DEBUG) ; - if( !m_conferences.tqcontains( room ) ) + if( !m_conferences.contains( room ) ) { kdDebug(YAHOO_GEN_DEBUG) << "Error. No chatsession for this conference found." << endl; return; @@ -1390,7 +1390,7 @@ void YahooAccount::slotConfMessage( const TQString &who, const TQString &room, c { kdDebug(YAHOO_GEN_DEBUG) ; - if( !m_conferences.tqcontains( room ) ) + if( !m_conferences.contains( room ) ) { kdDebug(YAHOO_GEN_DEBUG) << "Error. No chatsession for this conference found." << endl; return; @@ -1522,7 +1522,7 @@ void YahooAccount::slotGotFile( const TQString & who, const TQString & url , l void YahooAccount::slotReceiveFileAccepted(Kopete::Transfer *transfer, const TQString& fileName) { kdDebug(YAHOO_GEN_DEBUG) ; - if( !m_pendingFileTransfers.tqcontains( transfer->info().internalId() ) ) + if( !m_pendingFileTransfers.contains( transfer->info().internalId() ) ) return; m_pendingFileTransfers.remove( transfer->info().internalId() ); @@ -1531,7 +1531,7 @@ void YahooAccount::slotReceiveFileAccepted(Kopete::Transfer *transfer, const TQS //Create directory if it doesn't already exist TQDir dir; TQString path = TQFileInfo( fileName ).dirPath(); - for( int i = 1; i <= path.tqcontains('/'); ++i ) + for( int i = 1; i <= path.contains('/'); ++i ) { if( !dir.exists( path.section( '/', 0, i ) ) ) { @@ -1554,7 +1554,7 @@ void YahooAccount::slotReceiveFileAccepted(Kopete::Transfer *transfer, const TQS void YahooAccount::slotReceiveFileRefused( const Kopete::FileTransferInfo& info ) { - if( !m_pendingFileTransfers.tqcontains( info.internalId() ) ) + if( !m_pendingFileTransfers.contains( info.internalId() ) ) return; m_pendingFileTransfers.remove( info.internalId() ); @@ -1676,7 +1676,7 @@ void YahooAccount::slotGotWebcamInvite( const TQString& who ) return; } - if( m_pendingWebcamInvites.tqcontains( who ) ) + if( m_pendingWebcamInvites.contains( who ) ) return; m_pendingWebcamInvites.append( who ); @@ -1723,7 +1723,7 @@ void YahooAccount::slotGotBuddyIconChecksum(const TQString &who, int checksum) } if ( checksum == kc->property( YahooProtocol::protocol()->iconCheckSum ).value().toInt() && - TQFile::exists( locateLocal( "appdata", "yahoopictures/"+ who.lower().tqreplace(TQRegExp("[./~]"),"-") +".png" ) ) ) + TQFile::exists( locateLocal( "appdata", "yahoopictures/"+ who.lower().replace(TQRegExp("[./~]"),"-") +".png" ) ) ) { kdDebug(YAHOO_GEN_DEBUG) << "Icon already exists. I will not request it again." << endl; return; @@ -1741,7 +1741,7 @@ void YahooAccount::slotGotBuddyIconInfo(const TQString &who, KURL url, int check } if ( checksum == kc->property( YahooProtocol::protocol()->iconCheckSum ).value().toInt() && - TQFile::exists( locateLocal( "appdata", "yahoopictures/"+ who.lower().tqreplace(TQRegExp("[./~]"),"-") +".png" ) )) + TQFile::exists( locateLocal( "appdata", "yahoopictures/"+ who.lower().replace(TQRegExp("[./~]"),"-") +".png" ) )) { kdDebug(YAHOO_GEN_DEBUG) << "Icon already exists. I will not download it again." << endl; return; |