From 69cac65817d949cda2672ec4f0aa73d5e66a0ba1 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 22 Jun 2011 00:30:31 +0000 Subject: 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 --- kopete/protocols/msn/msnnotifysocket.cpp | 98 ++++++++++++++++---------------- 1 file changed, 49 insertions(+), 49 deletions(-) (limited to 'kopete/protocols/msn/msnnotifysocket.cpp') 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( "The MSN user '%1' does not exist.
Please check the MSN ID.
" ).arg( handle ); + msg = i18n( "The MSN user '%1' does not exist.
Please check the MSN ID.
" ).tqarg( handle ); type = MSNSocket::ErrorServerError; break; } @@ -134,7 +134,7 @@ void MSNNotifySocket::handleError( uint code, uint id ) "MSN Error: %1
" "please send us a detailed bug report " "at kopete-devel@kde.org 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( "The user '%1' already exists in this group on the MSN server;
" "if Kopete does not show the user, please send us a detailed bug report " "at kopete-devel@kde.org containing the raw debug output on the " - "console (in gzipped format, as it is probably a lot of output.)
" ).arg(handle); + "console (in gzipped format, as it is probably a lot of output.)" ).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 "\n" "
\n" "\n" - "\n" + "\n" "\n" "\n" "\n" @@ -641,7 +641,7 @@ void MSNNotifySocket::parseCommand( const TQString &cmd, uint id, const TQString "\n" "\n" "\n" - "\n" + "\n" "\n" "\n" "
\n\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: 301142409600204800 + //Mail-Data: 301142409600204800 // 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; imyselfClientId() + " " + 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; } -- cgit v1.2.1