diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
commit | 69cac65817d949cda2672ec4f0aa73d5e66a0ba1 (patch) | |
tree | 073fde0496ea90eb5bf5cffe66a8da43a9f55fbc /kopete/protocols/msn/msnnotifysocket.cpp | |
parent | 3467e6464beac3a162839bf7078e22e3a74d73e7 (diff) | |
download | tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.tar.gz tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.zip |
TQt4 port kdenetwork
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1237912 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/protocols/msn/msnnotifysocket.cpp')
-rw-r--r-- | kopete/protocols/msn/msnnotifysocket.cpp | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/kopete/protocols/msn/msnnotifysocket.cpp b/kopete/protocols/msn/msnnotifysocket.cpp index 3b3fc531..7db79dd1 100644 --- a/kopete/protocols/msn/msnnotifysocket.cpp +++ b/kopete/protocols/msn/msnnotifysocket.cpp @@ -90,14 +90,14 @@ void MSNNotifySocket::disconnect() m_isLogged = false; if( m_disconnectReason==Kopete::Account::Unknown ) m_disconnectReason=Kopete::Account::Manual; - if( onlineStatus() == Connected ) - sendCommand( "OUT", TQString::null, false ); + if( onlinetqStatus() == Connected ) + sendCommand( "OUT", TQString(), false ); if( m_keepaliveTimer ) m_keepaliveTimer->stop(); // the socket is not connected yet, so I should force the signals - if ( onlineStatus() == Disconnected || onlineStatus() == Connecting ) + if ( onlinetqStatus() == Disconnected || onlinetqStatus() == Connecting ) emit socketClosed(); else MSNSocket::disconnect(); @@ -108,7 +108,7 @@ void MSNNotifySocket::handleError( uint code, uint id ) kdDebug(14140) << k_funcinfo << endl; TQString handle; - if(m_tmpHandles.contains(id)) + if(m_tmpHandles.tqcontains(id)) handle=m_tmpHandles[id]; TQString msg; @@ -122,7 +122,7 @@ void MSNNotifySocket::handleError( uint code, uint id ) case 205: case 208: { - msg = i18n( "<qt>The MSN user '%1' does not exist.<br>Please check the MSN ID.</qt>" ).arg( handle ); + msg = i18n( "<qt>The MSN user '%1' does not exist.<br>Please check the MSN ID.</qt>" ).tqarg( handle ); type = MSNSocket::ErrorServerError; break; } @@ -134,7 +134,7 @@ void MSNNotifySocket::handleError( uint code, uint id ) "MSN Error: %1<br>" "please send us a detailed bug report " "at [email protected] containing the raw debug output on the " - "console (in gzipped format, as it is probably a lot of output.)" ).arg(code); + "console (in gzipped format, as it is probably a lot of output.)" ).tqarg(code); type = MSNSocket::ErrorServerError; break; } @@ -166,7 +166,7 @@ void MSNNotifySocket::handleError( uint code, uint id ) msg = i18n( "<qt>The user '%1' already exists in this group on the MSN server;<br>" "if Kopete does not show the user, please send us a detailed bug report " "at [email protected] containing the raw debug output on the " - "console (in gzipped format, as it is probably a lot of output.)</qt>" ).arg(handle); + "console (in gzipped format, as it is probably a lot of output.)</qt>" ).tqarg(handle); type = MSNSocket::ErrorInformation; break; } @@ -180,7 +180,7 @@ void MSNNotifySocket::handleError( uint code, uint id ) } case 219: { - msg = i18n( "The user '%1' seems to already be blocked or allowed on the server." ).arg(handle); + msg = i18n( "The user '%1' seems to already be blocked or allowed on the server." ).tqarg(handle); type = MSNSocket::ErrorServerError; break; } @@ -465,12 +465,12 @@ void MSNNotifySocket::parseCommand( const TQString &cmd, uint id, const TQString if( list == "FL" ) { // Removing a contact - if( data.contains( ' ' ) < 2 ) + if( data.tqcontains( ' ' ) < 2 ) { contactGuid = data.section( ' ', 1, 1 ); } // Removing a contact from a group - else if( data.contains( ' ' ) < 3 ) + else if( data.tqcontains( ' ' ) < 3 ) { contactGuid = data.section( ' ', 1, 1 ); groupGuid = data.section( ' ', 2, 2 ); @@ -541,7 +541,7 @@ void MSNNotifySocket::parseCommand( const TQString &cmd, uint id, const TQString m_challengeHandler = new MSNChallengeHandler("CFHUR$52U_{VIX5T", "PROD0101{0RM?UBW"); // Compute the challenge response hash, and send the response. TQString chlResponse = m_challengeHandler->computeHash(data.section(' ', 0, 0)); - sendCommand("QRY", m_challengeHandler->productId(), true, chlResponse.utf8()); + sendCommand("TQRY", m_challengeHandler->productId(), true, chlResponse.utf8()); // Dispose of the challenge handler. m_challengeHandler->deleteLater(); m_challengeHandler = 0L; @@ -563,7 +563,7 @@ void MSNNotifySocket::parseCommand( const TQString &cmd, uint id, const TQString kdDebug(14140) << k_funcinfo << "Contact list up-to-date." << endl; // set the status - setStatus( m_newstatus ); + settqStatus( m_newstatus ); } else if( cmd == "BPR" ) { @@ -592,11 +592,11 @@ void MSNNotifySocket::parseCommand( const TQString &cmd, uint id, const TQString else //FROM SYN m_account->configGroup()->writeEntry( "BLP" , data.section( ' ', 0, 0 ) ); } - else if( cmd == "QRY" ) + else if( cmd == "TQRY" ) { // Do nothing } - else if( cmd == "QNG" ) + else if( cmd == "TQNG" ) { //this is a reply from a ping m_ping=false; @@ -633,7 +633,7 @@ void MSNNotifySocket::parseCommand( const TQString &cmd, uint id, const TQString "<body onload=\"document.pform.submit(); \">\n" "<form name=\"pform\" action=\"" + from_action_url + "\" method=\"POST\">\n" "<input type=\"hidden\" name=\"mode\" value=\"ttl\">\n" - "<input type=\"hidden\" name=\"login\" value=\"" + UserID.left( UserID.find('@') ) + "\">\n" + "<input type=\"hidden\" name=\"login\" value=\"" + UserID.left( UserID.tqfind('@') ) + "\">\n" "<input type=\"hidden\" name=\"username\" value=\"" + UserID + "\">\n" "<input type=\"hidden\" name=\"sid\" value=\"" + m_sid + "\">\n" "<input type=\"hidden\" name=\"kv\" value=\"" + m_kv + "\">\n" @@ -641,7 +641,7 @@ void MSNNotifySocket::parseCommand( const TQString &cmd, uint id, const TQString "<input type=\"hidden\" name=\"sl\" value=\"" + sl +"\">\n" "<input type=\"hidden\" name=\"rru\" value=\"" + rru + "\">\n" "<input type=\"hidden\" name=\"auth\" value=\"" + m_MSPAuth + "\">\n" - "<input type=\"hidden\" name=\"creds\" value=\"" + TQString::fromLatin1( md5.hexDigest() ) + "\">\n" + "<input type=\"hidden\" name=\"creds\" value=\"" + TQString::tqfromLatin1( md5.hexDigest() ) + "\">\n" "<input type=\"hidden\" name=\"svc\" value=\"mail\">\n" "<input type=\"hidden\" name=\"js\" value=\"yes\">\n" "</form></body>\n</html>\n"; @@ -735,9 +735,9 @@ void MSNNotifySocket::slotReadMessage( const TQByteArray &bytes ) { TQString msg = TQString::fromUtf8(bytes, bytes.size()); - if(msg.contains("text/x-msmsgsinitialmdatanotification")) + if(msg.tqcontains("text/x-msmsgsinitialmdatanotification")) { - //Mail-Data: <MD><E><I>301</I><IU>1</IU><O>4</O><OU>2</OU></E><Q><QTM>409600</QTM><QNM>204800</QNM></Q></MD> + //Mail-Data: <MD><E><I>301</I><IU>1</IU><O>4</O><OU>2</OU></E><Q><TQTM>409600</TQTM><TQNM>204800</TQNM></Q></MD> // MD - Mail Data // E - email // I - initial mail @@ -758,14 +758,14 @@ void MSNNotifySocket::slotReadMessage( const TQByteArray &bytes ) TQT_SIGNAL(activated(unsigned int ) ) , this, TQT_SLOT( slotOpenInbox() ) ); } } - else if(msg.contains("text/x-msmsgsactivemailnotification")) + else if(msg.tqcontains("text/x-msmsgsactivemailnotification")) { //this sends the server if mails are deleted - TQString m = msg.right(msg.length() - msg.find("Message-Delta:") ); - m = m.left(msg.find("\r\n")); - mailCount = mailCount - m.right(m.length() -m.find(" ")-1).toUInt(); + TQString m = msg.right(msg.length() - msg.tqfind("Message-Delta:") ); + m = m.left(msg.tqfind("\r\n")); + mailCount = mailCount - m.right(m.length() -m.tqfind(" ")-1).toUInt(); } - else if(msg.contains("text/x-msmsgsemailnotification")) + else if(msg.tqcontains("text/x-msmsgsemailnotification")) { //this sends the server if a new mail has arrived TQRegExp rx("From-Addr: ([A-Za-z0-9@._\\-]*)"); @@ -775,32 +775,32 @@ void MSNNotifySocket::slotReadMessage( const TQByteArray &bytes ) mailCount++; //TODO: it is also possible to get the subject (but warning about the encoding) - TQObject::connect(KNotification::event( "msn_mail",i18n( "You have one new email from %1 in your MSN inbox." ).arg(m), + TQObject::connect(KNotification::event( "msn_mail",i18n( "You have one new email from %1 in your MSN inbox." ).tqarg(m), 0 , 0 , i18n( "Open Inbox..." ) ), TQT_SIGNAL(activated(unsigned int ) ) , this, TQT_SLOT( slotOpenInbox() ) ); } - else if(msg.contains("text/x-msmsgsprofile")) + else if(msg.tqcontains("text/x-msmsgsprofile")) { //Hotmail profile - if(msg.contains("MSPAuth:")) + if(msg.tqcontains("MSPAuth:")) { TQRegExp rx("MSPAuth: ([A-Za-z0-9$!*]*)"); rx.search(msg); m_MSPAuth=rx.cap(1); } - if(msg.contains("sid:")) + if(msg.tqcontains("sid:")) { TQRegExp rx("sid: ([0-9]*)"); rx.search(msg); m_sid=rx.cap(1); } - if(msg.contains("kv:")) + if(msg.tqcontains("kv:")) { TQRegExp rx("kv: ([0-9]*)"); rx.search(msg); m_kv=rx.cap(1); } - if(msg.contains("LoginTime:")) + if(msg.tqcontains("LoginTime:")) { TQRegExp rx("LoginTime: ([0-9]*)"); rx.search(msg); @@ -812,14 +812,14 @@ void MSNNotifySocket::slotReadMessage( const TQByteArray &bytes ) time(&actualTime); m_loginTime=TQString::number((unsigned long)actualTime); } - if(msg.contains("EmailEnabled:")) + if(msg.tqcontains("EmailEnabled:")) { TQRegExp rx("EmailEnabled: ([0-9]*)"); rx.search(msg); m_isHotmailAccount = (rx.cap(1).toUInt() == 1); emit hotmailSeted(m_isHotmailAccount); } - if(msg.contains("ClientIP:")) + if(msg.tqcontains("ClientIP:")) { TQRegExp rx("ClientIP: ([0-9.]*)"); rx.search(msg); @@ -829,7 +829,7 @@ void MSNNotifySocket::slotReadMessage( const TQByteArray &bytes ) // We are logged when we receive the initial profile from Hotmail. m_isLogged = true; } - else if (msg.contains("NOTIFICATION")) + else if (msg.tqcontains("NOTIFICATION")) { // MSN alert (i.e. NOTIFICATION) [for docs see http://www.hypothetic.org/docs/msn/client/notification.php] // format of msg is as follows: @@ -849,7 +849,7 @@ void MSNNotifySocket::slotReadMessage( const TQByteArray &bytes ) TQString notificationDOMAsString(msg); TQRegExp rx( "&(?!amp;)" ); // match ampersands but not & - notificationDOMAsString.replace(rx, "&"); + notificationDOMAsString.tqreplace(rx, "&"); TQDomDocument alertDOM; alertDOM.setContent(notificationDOMAsString); @@ -909,7 +909,7 @@ void MSNNotifySocket::slotReadMessage( const TQByteArray &bytes ) m_msnAlertURLs.append(subscString); // Don't do any MSN alerts notification for new blog updates - if( subscString != TQString::fromLatin1("s.htm") && actionString != TQString::fromLatin1("a.htm") ) + if( subscString != TQString::tqfromLatin1("s.htm") && actionString != TQString::tqfromLatin1("a.htm") ) { KNotification* notification = KNotification::event("msn_alert", textString, 0L, 0L, actions); TQObject::connect(notification, TQT_SIGNAL(activated(unsigned int)), this, TQT_SLOT(slotMSNAlertLink(unsigned int))); @@ -956,7 +956,7 @@ void MSNNotifySocket::slotReadMessage( const TQByteArray &bytes ) contact->setProperty(MSNProtocol::protocol()->propPersonalMessage, currentMedia.isEmpty() ? personalMessage : currentMedia); } } - m_tmpLastHandle = TQString::null; + m_tmpLastHandle = TQString(); } } @@ -1008,13 +1008,13 @@ TQString MSNNotifySocket::processCurrentMedia( const TQString &mediaXmlElement ) currentMedia = format; for(uint i=0; i<formatterStrings.size(); i++) { - currentMedia = currentMedia.replace(TQString("{%1}").arg(i), formatterStrings[i]); + currentMedia = currentMedia.tqreplace(TQString("{%1}").tqarg(i), formatterStrings[i]); } if( type == TQString::fromUtf8("Music") ) { // the "♫" is encoded in utf8 (and should be in utf8) - currentMedia = i18n("Now Listening: ♫ %1 ♫").arg(currentMedia); + currentMedia = i18n("Now Listening: ♫ %1 ♫").tqarg(currentMedia); } kdDebug(1414) << "Current Media received: " << currentMedia << endl; @@ -1049,25 +1049,25 @@ void MSNNotifySocket::addContact( const TQString &handle, int list, const TQStri // Adding the contact to a group if( !contactGuid.isEmpty() ) { - args = TQString("FL C=%1 %2").arg( contactGuid ).arg( groupGuid ); + args = TQString("FL C=%1 %2").tqarg( contactGuid ).tqarg( groupGuid ); kdDebug(14140) << k_funcinfo << "In adding contact to a group" << endl; } // Adding a new contact else { - args = TQString("FL N=%1 F=%2").arg( handle ).arg( escape( publicName ) ); + args = TQString("FL N=%1 F=%2").tqarg( handle ).tqarg( escape( publicName ) ); kdDebug(14140) << k_funcinfo << "In adding contact to a new contact" << endl; } break; } case MSNProtocol::AL: - args = TQString("AL N=%1").arg( handle ); + args = TQString("AL N=%1").tqarg( handle ); break; case MSNProtocol::BL: - args = TQString("BL N=%1").arg( handle ); + args = TQString("BL N=%1").tqarg( handle ); break; case MSNProtocol::RL: - args = TQString("RL N=%1").arg( handle ); + args = TQString("RL N=%1").tqarg( handle ); break; default: kdDebug(14140) << k_funcinfo <<"WARNING! Unknown list " << list << "!" << endl; @@ -1105,11 +1105,11 @@ void MSNNotifySocket::removeContact( const TQString &handle, int list, const TQS m_tmpHandles[id]=handle; } -void MSNNotifySocket::setStatus( const Kopete::OnlineStatus &status ) +void MSNNotifySocket::settqStatus( const Kopete::OnlineStatus &status ) { // kdDebug( 14140 ) << k_funcinfo << statusToString( status ) << endl; - if( onlineStatus() == Disconnected ) + if( onlinetqStatus() == Disconnected ) m_newstatus = status; else sendCommand( "CHG", statusToString( status ) + " " + m_account->myselfClientId() + " " + escape(m_account->pictureObject()) ); @@ -1185,17 +1185,17 @@ void MSNNotifySocket::changePersonalMessage( MSNProtocol::PersonalMessageType ty if( !mediaList[0].isEmpty() ) // Current Track { xmlCurrentMedia += "{0}"; - formatterArguments += TQString("%1\\0").arg(mediaList[0]); + formatterArguments += TQString("%1\\0").tqarg(mediaList[0]); } if( !mediaList[1].isEmpty() ) // Current Artist { xmlCurrentMedia += " - {1}"; - formatterArguments += TQString("%1\\0").arg(mediaList[1]); + formatterArguments += TQString("%1\\0").tqarg(mediaList[1]); } if( !mediaList[2].isEmpty() ) // Current Album { xmlCurrentMedia += " ({2})"; - formatterArguments += TQString("%1\\0").arg(mediaList[2]); + formatterArguments += TQString("%1\\0").tqarg(mediaList[2]); } xmlCurrentMedia += "\\0" + formatterArguments + "\\0"; break; @@ -1256,7 +1256,7 @@ TQString MSNNotifySocket::statusToString( const Kopete::OnlineStatus &status ) c void MSNNotifySocket::slotSendKeepAlive() { - //we did not received the previous QNG + //we did not received the previous TQNG if(m_ping) { m_disconnectReason=Kopete::Account::ConnectionReset; @@ -1269,7 +1269,7 @@ void MSNNotifySocket::slotSendKeepAlive() { // Send a dummy command to fake activity. This makes sure MSN doesn't // disconnect you when the notify socket is idle. - sendCommand( "PNG" , TQString::null , false ); + sendCommand( "PNG" , TQString() , false ); m_ping=true; } |